ruby on rails 3 - How to update datatime attribute? -


i want update last_clicked_on:datetime attribute current time.

class feedentriescontroller < applicationcontroller   def show     @feed_article = feedentry.find(params[:id])     @feed_article.update_attributes(is_to_read: 'false')     @feed_article.update_attributes(last_clicked_on: time.now)     @way = @feed_article.url     redirect_to @way   end end 

but above code not working. please me resolve issue.

i guess can try

@feed_article.is_to_read = 'false' @feed_article.last_clicked_on =  time.now @feed_article.save! 

anyway it's hard info. issue might in type of columns, can misspell name of column... else...

ps

each update_attributes issue transaction in db, so, have 2 transactions instead of one... code above have 1 transaction


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -