Ruby on Rails Recipes
A collection of recipes for solid Ruby on Rails applications. Extracted from dozens of production apps and 10,000+ hours of deliberate Ruby on Rails practice since 2005:
I know, I know,... Some people are concerned when they see the
in your app. Read this to find out why I think they are useful anyways.
The best practice to configure your app: Use ENV variables. Works for clusters, different types of deployments, and in development mode.
Pretty much any serious Rails project will require some kind of documentation. Here is a set of conventions that have worked well for me.
How to dynamically enable app features for a given user.
This flowchart helps you decide on the right approach when changing data. It's about Rails magic vs. Object Oriented best practices.
Let use cases and roles drive how you organize and name your Controllers and Views.
Advanced return values for complex processing. Includes a success indicator, return value and user messages in a uniform interface.
How to manage user roles and permissions.
Follow this style guide to make your code easy to read and reason about.