How to convert a ruby hash object to JSON? So I am trying this example below & it doesn't work?
I was looking at the RubDoc and obviously Hash object doesn't have a to_json method. But I am reading blogs, that Rails supports active_record.to_json and it also supports hash#to_json. I can understand ActiveRecord is a Rails object, but Hash is not native to Rails, its a pure Ruby object. So in rails you can do a hash.to_json, but not in pure ruby??
car = {:make => "bmw", :year => "2003"}
car.to_json