On 22 April 2010 15:22, Tom Ha <li...@ruby-forum.com> wrote: > Hi there, > > Suppose I submit an object called "task" from a form with... > > task[enddate(1i)] -> 2011 > task[enddate(2i)] -> 3 > task[enddate(3i)] -> 1 > > ...how do I set the value 'params[:task][:enddate]' to 'nil' in the > controller? > > I tried... > > params[:task][:enddate] = nil > > ...but that doesn't seem to "empty" the attribute 'enddate'. What am I > getting wrong?
It is difficult to see how that line could not set params[:task][:enddate] to nil, assuming it did not generate an error such as it would if params[:task] were nil. Are you sure it is executing that line of code? You could break in at that point using ruby-debug and check. See the rails guide on debugging for how to do it (google rails guides). 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.