Thursday, April 22, 2010

[Rails] How to: Set a datetime params-value to nil in the controller

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?

Thanks for your help!
Tom
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate