I’m trying to create a new date from form values and assign it to a variable.
Here’s the code I have so far:
eventDate = Date.new(params[:event]["date(1i)"],params[:event]["date(2i)"],params[:event]["date(3i)"])
However, I get the following error:
ArgumentError in EventsController#create
comparison of String with 0 failed
I have no idea what this means.
Any ideas?
Thank you,
Brian
The problem is that Date.new (which actually calls Date.civil) requires that you pass integers, and you are passing strings. Try: