ruby - Rails 4 strong params formatting with multiple keys -
i working service takes in number of custom attributes , serializes hash.
so this:
custom_contacts: {"address_book"=> [{"contact_list"=>"user_data", "contacts"=>[{"name"=>"user_data", "number"=>"user_data"}, {"name"=>"user_data", "number"=>"user_data"}, {"name"=>"user_data", "number"=>"user_data"}]}]}
the issue can't quite seem play nicely strong params in rails. i've read documentation here , can't seem wrap head around how set up.
you may need 1 "permit" blow.
a = actioncontroller::parameters.new( {"data_key"=> [{"name_key"=>"user_data", "organization_key"=>[{"key1"=>"user_data", "key2"=>"user_data"}, {"key3"=>"user_data", "key4"=>"user_data"}, {"key5"=>"user_data", "key6"=>"user_data"}]}]} ) a.permit(data_key: [:name_key, organization_key: [:key1, :key2, :key3, :key4, :key5, :key6]])
Comments
Post a Comment