Skip to content

Instantly share code, notes, and snippets.

@dukedorje
Created October 17, 2013 19:00
Show Gist options
  • Select an option

  • Save dukedorje/7030335 to your computer and use it in GitHub Desktop.

Select an option

Save dukedorje/7030335 to your computer and use it in GitHub Desktop.
Pass cache-busting asset paths to your javascript templates.
- js = "window.App = window.App || {}; App.assetPath={}; "
- ['login_logo.png', 'login_bg.png'].each do |asset_file|
- js << "App.assetPath['#{asset_file}']='#{asset_path(asset_file)}';"
:javascript
#{js}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment