News Aanad wrote in post #993479:
> hi, I have json string in json request.
> i want to update the database using that string.
> how can i do that?
> There would be a multipal object in this string.
>
> sample string is:
>
> 
[{"product":{"amt":300,"created_at":"2011-03-28T05:46:52Z","id":1,"prodnm":"maruti","qty":1,"rate":12,"updated_at":"2011-03-28T05:46:52Z"}},{"product":{"amt":2000,"created_at":"2011-04-18T09:02:45Z","id":2,"prodnm":"lux","qty":2,"rate":12,"updated_at":"2011-04-18T09:02:45Z"}}]
>
> Can anybody help me???

Deserialize the string into the separate product objects (JSON.parse 
from http://flori.github.com/json/ perhaps?), then use the normal object 
methods to perists the data I think.

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to