firstruby

Master ruby with us

Call Helper method from ActionMailer views in Ruby on Rails application

Posted by firstruby on February 2, 2011

If you want to call helper method from ActionMailer view in Ruby on Rails (RoR) application, you need to include helper (module) in Mailer file as,

If Helper module name is “UserHelper”, then need to write following in Mailer file,

add_template_helper(UserHelper)

After this, you will be able to access all the methods written in UserHelper in ActionMailer views.

Hope this is helpful.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: