Trying to pass string data produces the desired result in HTML but not sure why I am getting “missing ; before statement” error.
<%= javascript_tag do %>
window.context_user_email = <%= @context_user_email %>;
<% end %>
gives…
<script type="text/javascript">
//<![CDATA[
window.context_user_email = some@example.com;
//]]>
</script>
If you add quotes it will become a string variable, otherwise it is just a syntax error: