Ukrit Himakoon wrote: > rp8 -_- wrote: >> One way is to save a serialized hash into the db and you can deserialize >> the saved hash object back to params. >> >> Regards, >> >> rp8 >> ======================= >> http://lun.competo.com > > How to serialize would you mind giving me some example. > suppose that I've session['test'] which store several params inside > such as > session['test'] = idlist['1']=test&idlist['2']=test2 > > so I need to store this stuff inside my DB so if I need to serialized > what I have to do? require 'yaml'
serialized = obj.to_yaml new_obj = YAML::load(serialized) puts new_obj.width Regards, rp8 ======================= http://lun.competo.com -- 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

