I get an error
undefined `div 'method for" 11 ": String"
pointing to the @startdate line when I submit the form. I donβt understand what is going on at all. If I take steps in the rails console, it works fine.
In my controller, I:
@startday = params["startday_#{i}".to_sym] @startmonth = params["startmonth_#{i}".to_sym] @startyear = params["startyear_#{i}".to_sym].to_s @endday = params["endday_#{i}".to_sym] @endmonth = params["endmonth_#{i}".to_sym] @endyear = params["endyear_#{i}".to_sym].to_s @startdate = params["startdate_#{i}".to_sym] @price = params["price_#{i}".to_sym] @currency = params[:currency] @startdate = Date.new(@startyear, @startmonth, @startday) @enddate = Date.new(@endyear, @endmonth, @endday)
The hash that I send is:
{ "startmonth_1"=>"2", "startday_1"=>"11", "startyear_1"=>"12", "endmonth_1"=>"2", "endday_1"=>"13", "endyear_1"=>"12", "price_1"=>"12", }
If i do
@startee = @startyear.to_s + '-' + @startmonth.to_s + '-' + @startday return render :text => @startee
I get:
12-2-11
Therefore, I do not see a problem. Everything seems to be working fine.
Tim reistetter
source share