If you ever needed a way to render a Rails assets to a string, Hongli Lai from Phusion describes how. 🙂
I prepared a Gist wrapping it into a nice helper. 😀
module ApplicationHelper # thanks to http://blog.phusion.nl/2011/08/14/rendering-rails-3-1-assets-to-string/ # you may need to change the owner of the tmp/cache/* directories to the web servers user # e.g. for Debian systems: `chown -R www-data:www-data tmp/cache/*` def render_asset(asset) Conferator::Application.assets.find_asset(asset).body.html_safe end end