Morshed Alam
Morshed Alam Software Architect

Using helper method from action mailer views

• By Morshed Alam • Ruby on Rails
Action Mailer of Ruby on Rails(RoR) allows you to send emails from application using a mailer model and views. Sometimes you may need to use any helper method though it does not allow by default. In that case you have to include helper(module) in the Mailer class.

Say, you may need to use method(s) from ProductsHelper module, then you need to write following line in the Mailer file which will provide accessibility to use all methods written in ProductsHelper
add_template_helper(ProductsHelper)

Cheers!!

Comments (0)

No comments yet. Be the first to share your feedback or ask a question!

Leave a Comment