Module | ActionMailer::Helpers::ClassMethods |
In: |
lib/action_mailer/helpers.rb
|
Declare a helper:
helper :foo
requires ‘foo_helper’ and includes FooHelper in the template class.
helper FooHelper
includes FooHelper in the template class.
helper { def foo() "#{bar} is the very best" end }
evaluates the block in the template class, adding method foo.
helper(:three, BlindHelper) { def mice() 'mice' end }
does all three.
Declare a controller attribute as a helper. For example,
helper_attr :name attr_accessor :name
makes the name and name= controller methods available in the view. The is a convenience wrapper for helper_method.
Declare a controller method as a helper. For example,
helper_method :link_to def link_to(name, options) ... end
makes the link_to controller method available in the view.