On 22 April 2010 17:58, Tom Ha <[email protected]> wrote:
> Thanks for your inputs.
>
> Unfortunately, I can add that:
>
> 1. Yes, the code definitely GETS executed
> 2. No, params[:task] is definitely NOT nil
> 2. Other values of the Task object in params CAN be set to nil, for
> example...
>
>   params[:task][:name] = nil
>
> ...works correctly.
>
> Could it be that "...[:enddate]" is not sufficient in...
>
>  params[:task][:enddate]
>
> ...because the date gets submitted by a date_select? When I check what
> values get passed to params, I see...
>
>  task[enddate(1i)]  ->  2011
>  task[enddate(2i)]  ->  3
>  task[enddate(3i)]  ->  1
>
> Could it be that the problem stems from the "(1i), (2i), (3i)" part?

Well yes, quite likely.  So when you said that params[:task][:enddate]
was not getting set to nil, did you actually mean that the date in the
database when you save it is not cleared?  It looks like it might be
an idea to clear the three values in params that are used for setting
the date.  If you are not sure of the format then use ruby-debug to
break in, then you can inspect params and see exactly what is there so
you can clear it.

Colin

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to