strong_parameters in Rails using datetime

3

I am using strong_parameters to create a nested form object in a form . All my attributes work correctly, except those defined in datetime .

Is there anything special about receiving datetime nested?

Looking at the console, the attribute is being nested correctly, but it comes with the specification of Ni , with N 1 to 6 depending on which parameter it refers to (year, month, day ...) , but when creating the object ( INSERT INTO ), the attribute specified in datetime does not appear:

Processing by ReleasesController#create as HTML
Parameters: {"utf8"=>"✓", ... "release"=>{ ... "qm_attributes"=>{"user_id"=>"1", "start_at(1i)"=>"2014", "start_at(2i)"=>"3", "start_at(3i)"=>"31", "start_at(4i)"=>"14", "start_at(5i)"=>"57", "end_at(1i)"=>"2014", "end_at(2i)"=>"3", "end_at(3i)"=>"31", "end_at(4i)"=>"14", "end_at(5i)"=>"57", ... }}, "commit"=>"Create Release"}

SQL (0.3ms)  INSERT INTO "qms" ("created_at", "release_id", "tipo_qm_release", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?)
    
asked by anonymous 31.03.2014 / 17:22

1 answer

2

I found that datetime_selector of html does not work for objects nested to form. When I passed the date by text, everything worked correctly, making the correct parse for datetime . If anyone has questions about the whole process of using strong_parameters , I can be more specific.

    
31.03.2014 / 20:34