Pick a lesson below to get started.
Learn best practices for running Ruby on Rails 6 in production, including logging, audits, background jobs and admin portals.
1. Collaborative Accounts
Let users invite team members and collaborate within a shared account. Everything in your domain model should inherit from the Account. Consider that an Account has many Users through Memberships.
2. Role-Based Access Control
Role based access control (RBAC) functionality enables admins to limit the permissions of some users within a team. For example, a billing-only role for someone in procurement which can only access past invoices.
3. Friendly URL Slugging & Permalinks
It's a bad idea to expose your database primary keys. It's easy for hackers to guess values and attempt to access user data. Also, it exposes private business information such as how many accounts, invoices, etc., exist. Instead, create friendly URLs with custom permalinks.
4. Audit Trail for Security and Compliance
Keep an audit trail of all changes to your Rails models, which records who did what and when. It's a good security practice, helps with customer support troubleshooting, and bigger companies will require this if you're thinking of moving upmarket into enterprise sales.
5. JSON Log Files and Log Aggregation
Output Rails' log files as JSON, which is easier to parse, and send all logs to a centralized logging service for aggregation, analysis, and access.
6. Admin Portal
You need a great portal for backend website administration, including managing user accounts, modifying data, and masquerading (posing) as users for troubleshooting customer support issues.