improve helpers documentation
This commit is contained in:
parent
4ff6a8c65f
commit
ca0636444b
14
README.rdoc
14
README.rdoc
|
@ -679,21 +679,19 @@ route handlers and templates:
|
|||
bar(params[:name])
|
||||
end
|
||||
|
||||
Helper methods can be separately defined in a module:
|
||||
Alternatively, helper methods can be separately defined in a module:
|
||||
|
||||
module FooUtils
|
||||
def bar(name)
|
||||
"#{name}bar"
|
||||
end
|
||||
def foo(name) "#{name}foo" end
|
||||
end
|
||||
|
||||
module MooUtils
|
||||
# ...
|
||||
module BarUtils
|
||||
def bar(name) "#{name}bar" end
|
||||
end
|
||||
|
||||
helpers FooUtils, MooUtils
|
||||
helpers FooUtils, BarUtils
|
||||
|
||||
The effect is same as including a module.
|
||||
The effect is the same as including the modules in the application class.
|
||||
|
||||
=== Using Sessions
|
||||
|
||||
|
|
Loading…
Reference in New Issue