What Does ActiveRecord::MultiparameterAssignmentErrors Mean?

后端 未结 7 647
[愿得一人]
[愿得一人] 2020-12-15 22:46

I have a rails form with a datetime_select field. When I try to submit the form, I get the following exception:

ActiveRecord::MultiparameterAssignmentErrors          


        
7条回答
  •  心在旅途
    2020-12-15 23:16

    It turns out that rails uses something called Multi-parameter assignment to transmit dates and times in small parts that are reassembled when you assign params to the model instance.

    My problem was that I was using a datetime_select form field for a date model field. It apparently chokes when the multi-parameter magic tries to set the time on a Date object.

    The solution was to use a date_select form field rather than a datetime_select.

提交回复
热议问题