title: Ruby on rails DateTime require param
body: <p>Hi there i just need to require the param start_hour from my form so that i compare it to the database and check if it exist, but when i requiere the param that is in the form like</p>
  
  <pre><code>&lt;%= f.datetime_select :start_hour, { :order =&gt; [:month, :day, :year, :hour, :minute], :prompt =&gt; { :day =&gt; 'Dia', :month =&gt; 'Mes', :year =&gt; 'Ano', :hour =&gt; 'Hora', :minute =&gt; 'Minuto' } }, {:class =&gt; "form-control", :style =&gt; "display: inline-block;
      width: auto;
      vertical-align: middle;"}  %&gt;
  </code></pre>
  
  <p>i get that as nil in my controller, how can i require a datetime form then? many thanks. Here is my controller</p>
  
  <pre><code>def create
          @start_hour     =   params[:courtesie][:start_hour]
          @lesson_check   =   Lesson.find_by(start_date: @start_hour)
          if @lesson_check.present?
              @new_courtesie  =   Courtesie.new(courtesie_params)
              @new_schedule   =   Schedule.new()
              @new_schedule.options   =   params[:courtesie][:name]
              @new_schedule.lesson_id =   @lesson_check.id
              @new_schedule.user_id   =   current_user.id
  
              if @new_courtesie.save &amp;&amp; @new_schedule.save
                  flash[:success] = "Cortesia agendada"
                  redirect_to     cortesias_path
              end
          else
              flash[:warning] =   @start_hour
              redirect_to cortesias_path
          end
  
  end
  </code></pre>
  
  <p>form code </p>
  
  <pre><code>&lt;%= form_for(:courtesie, html: { class: "form-horizontal" } ) do |f| %&gt;
                                                    &lt;div class="form-group"&gt;
                                                      &lt;label class="control-label col-md-2" for="sitename"&gt; Nombre cortesia
                                                      &lt;/label&gt;
                                                      &lt;div class="col-md-9"&gt;
                                                        &lt;%= f.text_field :name, class: 'form-control' %&gt;
                                                      &lt;/div&gt;
                                                    &lt;/div&gt; 
  
                                                    &lt;div class="form-group"&gt;
                                                      &lt;label class="col-lg-2 control-label" for="sitename"&gt; Fecha cortesia&lt;/label&gt;
  
                                                      &lt;div class="col-lg-10"&gt;
  &lt;%= f.datetime_select :start_hour, { :order =&gt; [:month, :day, :year, :hour, :minute], :prompt =&gt; { :day =&gt; 'Dia', :month =&gt; 'Mes', :year =&gt; 'Ano', :hour =&gt; 'Hora', :minute =&gt; 'Minuto' } }, {:class =&gt; "form-control", :style =&gt; "display: inline-block;
      width: auto;
      vertical-align: middle;"}  %&gt;
                                                      &lt;/div&gt;
  
                                                    &lt;/div&gt; 
  
                                                    &lt;div class="form-group"&gt;
                                                      &lt;label class="control-label col-md-2" for="sitename"&gt; Telefono &lt;/label&gt;
                                                      &lt;div class="col-md-5"&gt;
                                                        &lt;%= f.number_field :phone, class: 'form-control' %&gt;
                                                      &lt;/div&gt;
                                                    &lt;/div&gt;
                                                    &lt;div class="form-group"&gt;
                                                      &lt;label class="control-label col-md-2" for="sitename"&gt; Email &lt;/label&gt;
                                                      &lt;div class="col-md-5"&gt;
                                                        &lt;%= f.text_field :email, class: 'form-control' %&gt;
                                                      &lt;/div&gt;
                                                    &lt;/div&gt; 
                                                    &lt;div class="form-group"&gt;
                                                       &lt;div class="col-lg-9 col-lg-offset-2"&gt;
                                                       &lt;%= f.submit "Guardar", class: "btn btn-primary" %&gt;
                                                          &lt;button type="reset" class="btn btn-default"&gt;Reiniciar&lt;/button&gt;
                                                       &lt;/div&gt;
                                                    &lt;/div&gt;
                                        &lt;% end %&gt;
  </code></pre>