module ActionController::Helpers::ClassMethods
def all_application_helpers
def all_application_helpers helpers = [] Array.wrap(helpers_path).each do |path| extract = /^#{Regexp.quote(path.to_s)}\/?(.*)_helper.rb$/ helpers += Dir["#{path}/**/*_helper.rb"].map { |file| file.sub(extract, '\1') } end helpers.sort! helpers.uniq! helpers end
def helper_attr(*attrs)
*attrs
==== Parameters
attr_accessor :name
helper_attr :name
controller and makes them available to the view:
following adds new +name+ and name= instance methods to a
Declares helper accessors for controller attributes. For example, the
def helper_attr(*attrs) attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") } end
def helpers
def helpers @helper_proxy ||= ActionView::Base.new.extend(_helpers) end
def helpers_dir
def helpers_dir ActiveSupport::Deprecation.warn "helpers_dir is deprecated, use helpers_path instead", caller self.helpers_path end
def helpers_dir=(value)
def helpers_dir=(value) ActiveSupport::Deprecation.warn "helpers_dir= is deprecated, use helpers_path= instead", caller self.helpers_path = Array.wrap(value) end
def modules_for_helpers(args)
Array[Module]:: A normalized list of modules for the list of
==== Returns
args
==== Parameters
all helpers in helpers_dir.
Overwrite modules_for_helpers to accept :all as argument, which loads
def modules_for_helpers(args) args += all_application_helpers if args.delete(:all) super(args) end