Created
January 20, 2010 22:03
-
-
Save cpjolicoeur/282330 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## in your app layout file in the <head> section add this | |
<script type="text/javascript"> | |
<%= yield :scripts_text %> | |
</script> | |
## in your action view erb file do this at the bottom | |
<% content_for :scripts_text do %> | |
// raw JS here or erb interpreted JS | |
var my_var = <%= SOME_RUBY_CONSTANT %>; | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment