Read my latest article: 8 things I look for in a Ruby on Rails app (posted Thu, 06 Jul 2017 16:59:00 GMT)

Storing Rails ERb templates in the database, continued

Posted by Fri, 10 Jun 2005 14:43:48 GMT

In edge-rails, there are new ways of rendering templates.

In my previous posts, I showed how to render a template stored in the database to a variable for usage in generating a PDF. In edge-rails, this is now solved with:

  letter = render_string_to_string(letter_template.body)

Now becomes:

  letter = render(:inline => letter_template.body)


However, until the next release of Rails is out, unless you’re using Edge Rails, you can use my hack in the meantime.
Get help with your Rails project

comments powered by Disqus