I have a newbie ?. I have a form that looks like this:
<%= start_form_tag :action=>"save_scheduling" %>
<%= datetime_select("scheduled_at", "written_on") %>
<%= submit_tag("update") %>
<%= end_form_tag %>
and a controller script that looks like this with the column
scheduled_at set to a datetime field:
def save_scheduling
mail=Mail.find(5)
#scheduled_at=DateTime.now
mail.update_attributes(:scheduled_at=>params[:scheduled_at])
end
when, i submit, I always get:
scheduled_at: 0000-00-00 00:00:00
in MySQL, even when there are time. If I manually set the scheduled_at
value and change the update_attributes, the time gets set to now. It
seems like a problem accessing the params variable correctly. The
variable does appear to get set to a ruby DateTime value correctly as
the null value (set as default) is gone.
any help would be appreciated.
-jon
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---