On Monday, April 25, 2011 12:00:43 PM UTC-4, Ruby-Forum.com User wrote:
>
> I find this odd because I haven't even inputted any variables in the
> view yet the date is invalid?
>

Actually that's probably exactly why you have an invalid date. If you 
haven't input any variables yet, params hash will be empty. This means the 
code you posted basically evaluates to the following:

   Date.new(nil.to_i, nil.to_i, nil.to_i)

Which returns your ArgumentError.

Can you wrap the Date.new call in an *if *statement so it only gets executed 
once the form has been submitted?

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