Hi, I''m trying to send some emails with the same formatting as my pages & I can''t seem to access my display routines in application_helper.rb. I''m trying a hack to bypass this. At the top of my ActionMailer notifier script I''ve included application_helper.rb - my understanding is that this should arrive as a module and should be able to be used accordingly. <% require File.dirname(__FILE__) + ''/../../helpers/application_helper.rb'' %> <% display_money = ApplicationHelper.display_money -%> However I get a compile error: undefined method `display_money'' for ApplicationHelper:Module The ''display_money'' routine does exist in application_helper.rb & is working happily when rendering my pages. Any ideas on how I can overcome this? -- 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 -~----------~----~----~----~------~----~------~--~---
Matt Stone wrote:> Hi, > > I''m trying to send some emails with the same formatting as my pages & I > can''t seem to access my display routines in application_helper.rb. I''m > trying a hack to bypass this. >I think you can make the application helper available by adding: helper :application to the mailer model. -- 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 -~----------~----~----~----~------~----~------~--~---
Indeed you can - works great now. Many thanks. Rob Nichols wrote:> Matt Stone wrote: >> Hi, >> >> I''m trying to send some emails with the same formatting as my pages & I >> can''t seem to access my display routines in application_helper.rb. I''m >> trying a hack to bypass this. >> > I think you can make the application helper available by adding: > > helper :application > > to the mailer model.-- 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 -~----------~----~----~----~------~----~------~--~---
Apparently Analagous Threads
- testing application_helper.rb
- Best way to access constants in application_helper.rb from views?
- ActionMailer view templates don''t pick up application_helper.rb?
- [TDD] [Rails] - Rspec test for application_helper.rb fails when trying to access application_controller method.
- using application_helper.rb