How to use my view helpers in my ActionMailer views?

up vote
3
down vote
favorite
|
I want to use the methods I defined in Based on this guide it seems like the (BTW, is there a reason you get access to a different set of helpers in mailer views? This is pretty annoying.)
ruby-on-rails
|
2 Answers
up vote
6
down vote
accepted
|
In the model class that you are using to manage your emails:
| ||
|

up vote
0
down vote
|
This might give you some direction, I have a method "check_options" defined in "app/helpers/app_helper.rb" In my controller that renders the view "app/controllers/app_controller.rb" I have the following line
and then finally in my view I just call the "check_options" like
From the documentation link that you posted looks like you might need
Give this link a try as well http://caboo.se/doc/classes/ActionController/Helpers/ClassMethods.html there are some examples that might help A small excerpt from the page "By default, the controller will include a helper whose name matches that of the controller, e.g., MyController will automatically include MyHelper." Cheers | ||
最后
以上就是尊敬巨人最近收集整理的关于How to use my view helpers in my ActionMailer views?How to use my view helpers in my ActionMailer views?的全部内容,更多相关How内容请搜索靠谱客的其他文章。