To include a Rails helper, helper :helper_name and to include all helpers, helper :all is specified in the application_controller.
Now, how to include say N-1 of the available helpers? In other words, how to exclude a very few helpers?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you would need to write a custom method (say,
all_helpers) to get symbols (:foo) or module names (FooHelper) for all of your helpers (probably via file system calls to theapp/helpersdirectory) and then allow an exclusion list to be passed to the method. Then call it something like:Take a look at Rails’
ActionController::Helpers#all_application_helpersmethod for details on how to pull helper names from the filesystem.