Eric Gross
2006-Sep-30 11:37 UTC
modularized controller can''t find application_helper methods
Hey everyone, Im having this weird problem. I made a controller by calling it home/my_inbox to try to modularize everything. However, I cant call any methods from the application_helper.rb file. Any reason why? NoMethodError in Home/my inboxController#message undefined method `book_viewing_message?'' for #<Home::MyInboxController:0x3a311b0> RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace #{RAILS_ROOT}/app/controllers/home/my_inbox_controller.rb:12:in `message'' -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Paul Mckibbin
2008-Mar-17 04:46 UTC
Re: modularized controller can''t find application_helper met
Aryk Grosz wrote:> home/my_inbox to try to modularize everything. However, I cant call anyIt looks like you are trying to call it directly from the controller, you should be calling the method from the view template instead. Methods defined in application_helper.rb are available to all view templates, not directly from the controller. (You can do it, but you need to define a couple of other things inside the Application Controller, and it''s not very clean) I''d personally put the required methods into a separate class/module in the lib directory and then require them from the controllers you need to use. Mac -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---