So I have a web app and for it, I store raw params in the database in case I ever need to track down an issue and unfortunately I had an issue where it would be useful to go back to the original form parameters to sort our some missing RSVPs to an event.
Unfortunately the form has a few nested fields and parsing those back out has proven to be tough. Here is an example of a raw form post (with the data obfuscated):
{"utf8"=>"✓", "authenticity_token"=>"XXXX...=", "focus_group_invite_url_code"=>"XXXXXXX", "event_group_id"=>{"-1"=>""}, "event"=>{"id"=>"-1"}, "spouse"=>{"name"=>""}, "email"=>{"address"=>"XXXX@XXXX.com"}, "phone"=>{"number"=>"5555551212"}, "commit"=>"RSVP", "action"=>"create", "controller"=>"my_controller"}
I've tried using a few ways to split into hashes, but because of the nested nature of a few of these this is proving tough. I also tried using URI.www_form_decode and ActiveSupport::JSON.decode and neither worked. I'm thinking there must be an easy way to do this that I'm missing. Hoping someone has a suggestion.