I\'m trying to create an HTML string using a view. I would like to render this from a class that is not a controller. How can I use the rails rendering engine outside a co
Technically, ActionMailer
is a subclass implementation of AbstractController::Base
. If you want to implement this functionality on your own, you'll likely want to inherit from AbstractController::Base
as well.
There is a good blog post here: https://www.amberbit.com/blog/2011/12/27/render-views-and-partials-outside-controllers-in-rails-3/ that explains the steps required.