2012-09-27 24 views
3

我用mongodb作爲我的數據庫和驅動程序mongoid。如何在Mongoid中爲datetime_select helper使用update_attributes?

我的一個模型Bill有一個字段是LOCAL_TIME,我用datetime_select的觀點:

.ym-fbox-select      
    = f.label :local_time, "Time" 
    = f.datetime_select :local_time 

create行動確定。但update行動不是。 錯誤是這樣的:

(eval):1: syntax error, unexpected tINTEGER, expecting ')' 
    def local_time(1i)=(value) 

update是:

def update         
@bill = Bill.find(params[:id])    

respond_to do |format|      
    if @bill.update_attributes(params[:bill]) 

所以我想知道如何更新local_time場?

回答

1

除了什麼@Peter說我想包括
包括Mongoid :: MultiParameterAttributes應低於包括Mongoid ::文件
給出here