Why is my method in application_controller not visible?
In my开发者_开发问答 applicatin_controller.rb I added:
def test?
true
end
I tried using it in my view and it didn't work
<%= test? %>
error:
undefined method
Controller methods are not accessible in the view by default. Try the following:
def test?
true
end
helper_method :test?
精彩评论