Anil Wadghule
2008-Jan-15 06:29 UTC
How to access application_helper methods in mailer templates
Hi, I am not able to access application_helper methods in my mailer templates. It throws out error saying method not defined. I was assuming all templates under views should have access to application helper methods, but it is not the case. Any solution? -- Anil http://anilwadghule.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 -~----------~----~----~----~------~----~------~--~---
Greg Donald
2008-Jan-15 16:53 UTC
Re: How to access application_helper methods in mailer templates
On 1/15/08, Anil Wadghule <anildigital-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am not able to access application_helper methods in my mailer templates. > It throws out error saying method not defined. I was assuming all templates > under views should have access to application helper methods, but it is not > the case. Any solution?You can always put the methods in config/environment.rb. -- Greg Donald http://destiney.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 -~----------~----~----~----~------~----~------~--~---
blinking bear
2008-Jan-15 16:56 UTC
Re: How to access application_helper methods in mailer templates
Add helper:application to the top of your Mailer class for example: class MessagingNotifier < ActionMailer::Base helper :application ... end On Jan 15, 2008 11:53 AM, Greg Donald <gdonald-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 1/15/08, Anil Wadghule <anildigital-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi, > > > > I am not able to access application_helper methods in my mailer > templates. > > It throws out error saying method not defined. I was assuming all > templates > > under views should have access to application helper methods, but it is > not > > the case. Any solution? > > You can always put the methods in config/environment.rb. > > > -- > Greg Donald > http://destiney.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 -~----------~----~----~----~------~----~------~--~---