Datetime_select and accessing in controller correctly

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

any ideas on this? thx jon

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs