Forum: Ruby on Rails ActionMailer

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E928c13a99447cf822052b514f14e109?d=identicon&s=25 Ralph Herve (tanker)
on 2009-03-02 14:33
i have this in my mdel infomailer.rb

class Infomailer < ActionMailer::Base
  helper :application
end

but i can't understand why i can't use method defined i
application_helper.rb

in template app/views/infomailer/send_order.html.erb

please help
0348be81e22f24afdaa6e4f137aa9dfc?d=identicon&s=25 Priya Buvan (priyadharsini)
on 2009-03-03 06:41
Ralph Herve wrote:
> i have this in my mdel infomailer.rb
>
> class Infomailer < ActionMailer::Base
>   helper :application
> end
>
> but i can't understand why i can't use method defined i
> application_helper.rb
>
> in template app/views/infomailer/send_order.html.erb
>
> please help

You can write the methods whichever you want to send mail in model
itself. Why you are going for helper..
You can call this method whereever you want.
This topic is locked and can not be replied to.