Forum: Ruby on Rails Select date... date

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
0338d257688889ebba17b3215fef52e6?d=identicon&s=25 Chika (Guest)
on 2007-02-01 14:18
I still have problems with dates. 2 of them this time.the first is that
I have 2 date_select for the users to select a period for a report, but
when I try to read them in the controller I get a nil error.... but they
are not nil...wierd.

- rhtml:
<td></td> <td><strong>Desde</strong>
           <%= date_select('reporte', 'inicio',:order => [:day, :month,
          <%= date_select('reporte', 'termino',:order => [:day, :month,

- controller:
  string = 'usuario_id = '+
  string+= ' AND tipo in ' + array_to_string(@tipo,',')
  string+='AND created_at >' +(params[:reporte][:inicio])
  string+='AND created_at <' +(params[:reporte][:termino])
  string+='ORDER BY '+@orderempresa

and the error:

can't convert nil into String
Parameters: {"commit"=>"Generar Reporte",
"reporte"=>{"inicio(1i)"=>"2007", "inicio(2i)"=>"1", "inicio(3i)"=>"1",
"termino(1i)"=>"2007", "termino(2i)"=>"1", "termino(3i)"=>"31",
"orden"=>"operacion"}, "usuario"=>"9",
"operaciones"=>{"creaciones"=>"true", "eliminaciones"=>"true",

As you can see it's not nil... ¿anybody knows why this happens?
The second problem is that I getting a year (of studies) without any
problem, but when I show the information, it doesn't show the recorded
year, it shows 2007.

The select is in the rhtml as follows:

<% @persona.estudios.each do |@e|%>
    <tr id="estudio <>">
      <td><strong>Grado:</strong><%= text_field ('e[]','grado')%></td>
            <td><strong>Institucion:</strong><%= text_field
('e[]','institucion') %></td>
            <%= select_year(, :start_year => 1950,
and nothing, it doesn't show error or anything just a wrong year.
Any thoughts?

Muchas gracias!!!
This topic is locked and can not be replied to.