json - Rails: to_json method not working as expected -


i'm bit stumped on this. have user model. trying convert instances json format. however, it's not returning expect:

> u = user.first > u.to_json => "\"#<user:0x104ac7718>\""  

instead of returning hash of object's attributes, to_json returning string name of model. ideas?


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -