If I have a homecontroller, will the home_helper.rb get mixed into the controller class?
I'm assuming so as it gets 开发者_开发百科access to the request object somehow.
No, helpers do not get mixed into controllers. You can hack rails but your best bet is to just include the method in application_helper.rb
This seems to be the best hack:
http://snippets.aktagon.com/snippets/47-Using-Rails-helpers-from-controllers-or-anywhere-you-want
精彩评论