← Back to Upcase

Including all view helpers automatically or specific ones?

(Justin Gordon) #1

Are others using the default of including all view helpers automatically or specific ones?

http://api.rubyonrails.org/classes/ActionController/Helpers.html

The Rails framework provides a large number of helpers for working with assets, dates, forms, numbers and model objects, to name a few. These helpers are available to all templates by default.

In addition to using the standard template helpers provided, creating custom helpers to extract complicated logic or reusable functionality is strongly encouraged. By default, each controller will include all helpers. These helpers are only accessible on the controller through .helpers

In previous versions of Rails the controller will include a helper whose name matches that of the controller, e.g., MyController will automatically include MyHelper. To return old behavior set config.action_controller.include_all_helpers to false.

0 Likes