I used mongodb as my database and the driver mongoid.
One of my model Bill has a field is local_time, and I used datetime_select in the view:
.ym-fbox-select
= f.label :local_time, "Time"
= f.datetime_select :local_time
the create action is OK. But the update action is not.
The error is like this:
(eval):1: syntax error, unexpected tINTEGER, expecting ')'
def local_time(1i)=(value)
and the update is :
def update
@bill = Bill.find(params[:id])
respond_to do |format|
if @bill.update_attributes(params[:bill])
So I want to know how to update the local_time field?
Add
include Mongoid::MultiParameterAttributesto your model, just as you would for Timestamps.See: https://github.com/mongoid/mongoid/issues/892#issuecomment-1247311