Skip to content

Instantly share code, notes, and snippets.

@rymawby
Created July 9, 2013 18:28
Show Gist options
  • Select an option

  • Save rymawby/5959875 to your computer and use it in GitHub Desktop.

Select an option

Save rymawby/5959875 to your computer and use it in GitHub Desktop.
Setting javascript within erb files (rails).
<%= javascript_tag do %>
window.variable_name = <%=j rails_var %>;
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment