[Rails] Re: Date from user input

2011-04-25 Thread Tom Ricks
I must have made some mistake because I checked if request.post? Date.new(params[:year].to_i, params[:month].to_i, params[:day].to_i) end again and it does not call an error either. However anytime I input any numbers into the fields, i get the same invalid date error. Is there something wrong

[Rails] Re: Date from user input

2011-04-25 Thread Tom Ricks
Tim Shaffer wrote in post #994920: > The easiest way is probably just "if request.post?" > > Be careful though - it could be a post request without the parameters > you > are looking for. Might also be helpful to check if the params hash > contains > the keys you plan on using. > > Another option i

[Rails] Re: Date from user input

2011-04-25 Thread Tim Shaffer
The easiest way is probably just "if request.post?" Be careful though - it could be a post request without the parameters you are looking for. Might also be helpful to check if the params hash contains the keys you plan on using. Another option is to just try it, then ask for forgiveness: beg

[Rails] Re: Date from user input

2011-04-25 Thread Tom Ricks
Tim Shaffer wrote in post #994906: > 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 > hav

[Rails] Re: Date from user input

2011-04-25 Thread Tim Shaffer
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 wil