How to convert a rails Active Records object’s id:name hash object to JSON format object
Users.select("id,name").all
To json
{1:manish,2:john,3:paulo}
I want the output json like above,So I can use that in my JavaScript.
Please help me regarding this!
You can do this: