Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Render Rails assets to string
module ApplicationHelper
# thanks to
# 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)

This comment has been minimized.

Copy link

niyando commented Jun 3, 2016

this doesn't work with assets with erb extension .. for eg.. blabla.js.erb
It does render, but the embedded ruby remains un-executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.