Skip to content

Instantly share code, notes, and snippets.

@alekpopovic
Created March 15, 2023 13:01
Show Gist options
  • Save alekpopovic/16e7b565e32a0fa6778aeed3f4064039 to your computer and use it in GitHub Desktop.
Save alekpopovic/16e7b565e32a0fa6778aeed3f4064039 to your computer and use it in GitHub Desktop.
ruby varst to js object
<%=
name = "Aleksandar"
age = 41
city = "Mozgovo"
%>
<script>
var object = JSON.parse('{"name":"<%= name %>", "age":"<%= age %>", "city":"<%= city %>"}')
console.log(object)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment