Flowdock
method

helper

Importance_1
v1.1.6 - Show latest stable - 0 notes - Class: ActionController::Helpers::ClassMethods
helper(*args, &block) public

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.

Show source
Register or log in to add new notes.