Jonathan Bennett

Solve your Rails Problems with More Models

One of the most common ways I solve problems in a Rails app is by creating more model classes.

Note: The folder is called models note table_classes. These classes don’t have to extend ActiveRecord::Base

For instance, if you have a page with a primary record and a bunch of related or computed stuff, move it into a custom object and clear up your view’s code.

My ideal view has simple if, and each statements, minimal logic, and lots of render calls.

What are some of your rules-of-thumb for development?