JSON column and nested attributes

7 views
Skip to first unread message

Justin Morgan

unread,
Dec 6, 2015, 12:20:48 AM12/6/15
to SimpleForm
Is it possible to get my form to produce the proper nested params for my JSON column?

params.require(:reservation).permit(
        :user_id, 
        :type_of_reservation, 
        :arrival, 
        :departure, 
        :power, 
        :number_of_people, 
        admin:   
          [ :dogs, :directions, 
              tenting: [:number_of_tents], 
              rv: [:type_of_unit, :length_of_unit]
          ]
      ) 

Carlos Antonio da Silva

unread,
Dec 19, 2015, 11:23:58 AM12/19/15
to plataformate...@googlegroups.com
You should be able to achieve something like that with simple_fields_for/fields_for, have you had a chance to try that?

Hope that helps.

--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
At.
Carlos Antonio
Reply all
Reply to author
Forward
0 new messages