I've developed an index.html.erb file containing Ruby and HTML code, which is currently running on a webrick server at localhost without the use of Rails.
In my Ruby code, I have a Global JSON variable structured as follows :
@ruby_side_json = [{ :name => 'Will', :age => 23 },{ :name => 'John', :age => 30 }].to_json
I'm looking to assign this variable to a JavaScript variable located within a script.
My attempt using:
var javascript_side_json = <%= @ruby_side_json %>
has not proven successful. What steps should I take to achieve this?