SyntaxFix
Write A Post
Hire A Developer
Questions
Add the following line on the top of your file
require 'json'
Then you can use:
car = {:make => "bmw", :year => "2003"} car.to_json
Alternatively, you can use:
JSON.generate({:make => "bmw", :year => "2003"})