On Apr 22, 5:58 pm, Tom Ha <[email protected]> wrote:

> ...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?
>

> Any ideas?

Unless i've misunderstood what you are attempting, you need to clear
out the 3 parts of end date. You can't remove params[:task][:enddate]
because it doesn't exist - when activerecord sees parameters with the
appropriate naming convention it gathers them together to create an
instance of Time and assigns that to the task's enddate. If you want
to set enddate to nil it would probably be enough to remove those 3
parts and then set params[:task][:enddate] to nil (although why jump
through all those hoops and not just do some_task.enddate = nil ?)

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

-- 
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