module AbstractController::Helpers::ClassMethods
def modules_for_helpers(args)
* Array - A normalized list of modules for the list of
==== Returns
* args - An array of helpers
==== Parameters
are returned.
After loading the appropriate files, the corresponding modules
Module:: No further processing
and "foo_bar_helper.rb" is loaded using require_dependency.
String or Symbol:: :FooBar or "FooBar" becomes "foo_bar_helper",
helpers with the following behavior:
Returns a list of modules, normalized from the acceptable kinds of
def modules_for_helpers(args) args.flatten.map! do |arg| case arg when String, Symbol file_name = "#{arg.to_s.underscore}_helper" require_dependency(file_name, "Missing helper file helpers/%s.rb") file_name.camelize.constantize when Module arg else raise ArgumentError, "helper must be a String, Symbol, or Module" end end end