ex:
module TestHelper
def run
"test_title"
end
end
in the test controller
<%= run %>
originally the function in the helper file can only be accessed by related view,
but there is method for sharing helper
sharing helper:
method 1:
define the method in application_helper.rb
method 2:
ex:
add TestHelper to controller
helper :test
沒有留言:
張貼留言