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 controller? Similar to how ActionMailer does?
Thanks!
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 controller? Similar to how ActionMailer does?
Thanks!
There is no need to over bloat your app with too many gems. As we know ERB is already included in your Rails app.
Above there is snippet of code of an app I'm working on.
@jdf
is a object to be evaluated in theerb
view.xml
.result
is a string to be saved or sent anywhere you like.