I have stored the content of a .html.erb file in the database. I now want to render the ERB data into a string without displaying it.
I tried
rendered = render_to_string(:template => MailTemplate.find(1).body)
but it throws Missing template. Does the render_to_string method only work with an actual file?