Rails: How to create javascript object from controller?
I am using Rails 3. I just want to create a simple javascript object from my controller. I don't want to render js because I'm already rendering html page and I want that javascript object in that html page.
You want to make data from the controller available in javascript? Then you should use JSON. You can convert any ruby datatype into a json object with the .to_json