improve helpers documentation

This commit is contained in:
Konstantin Haase 2012-01-02 18:34:34 +01:00
parent 4ff6a8c65f
commit ca0636444b
1 changed files with 6 additions and 8 deletions

View File

@ -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