select_date designed to create drop-down lists that are not related to the model field (with the idea that you can pick them up from the other side and do what you want with them). I assume you mean date_select , which runs the model?
In any case, as far as I know, a short story, there is nothing nice and beautiful way to make it work. This is not due to the way the assistant works, but because the active record deals with these attributes, divided into several parameters.
In a little more detail, if you are interested, the reason why this does not work is that when Active Record deals with the parameters that you passed, it goes through execute_callstack_for_multiparameter_attributes , which interprets the keys that were split into the "date" style (1i) ", and redirects them to the appropriate class that they should be (a date or time object), how it works, whether to create a date or time, checking it against the attribute type ( see here ), but since your attribute "startdate" is not bound to a specific type, it is not processed appears as a date or date column in db.
I think I will deal with it just like @ Phyo-Wai-Win, but use select_date to set another parameter outside the search namespace, which you then go into the model as needed in the controller. Thus, it is not so much, and it means that you do not bother with how you initialize the record or what attributes it expects.
source share