Don’t Conflate Helpers with the Domain

Learn about helpers and why we should not confuse them with our domain.

Helpers are handy, yet also a magnet for mess and unsustainability. We are not going to give a perfectly clean and sustainable solution here, but we can help clarify the issues with helpers, explain the best way to use them, and help ease some of the confusion.

Helpers are a way (the only way) to export methods to be available to a view. Any method defined in app/helpers/application_helper.rb will be included and available to all our views. Helpers can also be added via the helper_method in a controller, which will import methods from a class, module, block of code, or really anywhere.

Get hands-on with 1400+ tech skills courses.