Skip to content

Instantly share code, notes, and snippets.

@techsethi
Last active March 26, 2017 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techsethi/f6e91a1639dd44612ef8941866b82f16 to your computer and use it in GitHub Desktop.
Save techsethi/f6e91a1639dd44612ef8941866b82f16 to your computer and use it in GitHub Desktop.
# Trying to include a .js.erb file
<script type='text/javascript' src='/js/test.js.erb'></script>
# getting error
# ActionController::RoutingError (No route matches [GET] "/js/test.js.erb"):
# cntent of test.js.erb
# I want to be able to include ruby code in test.js.erb
alert('<%= params[:controller] %>') ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment