Hi all, I want to include helper module into controller and I tried to use helper method but it doesn''t work. It actually works in Rails 2.X. For instance, I have AppletsHelper and I want to include that module in my controller. So, in my controller I would write helper :applets but still I can''t call method in that helper "undefined local variable or method". Is it a bug in Rails 3.X? Cheers, -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Oct-13 07:29 UTC
Re: helper method does not include helper module into controller
On 12 Oct, 17:24, Sophy <ungso...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > I want to include helper module into controller and I tried to use > helper method but it doesn''t work. It actually works in Rails 2.X. > For instance, I have AppletsHelper and I want to include that module > in my controller. So, in my controller I would write > > helper :applets > > but still I can''t call method in that helper "undefined local variable > or method". > Is it a bug in Rails 3.X?The helper method includes the named module in the views of that controller - it doesn''t include the module in the controller itself. If that''s what you want then just include the module yourself Fred> > Cheers,-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.