title: Rails Table with where clause and order by
body: <p>I am fairly new to rails so I am not familiar with the SQL for rails.
  I have the following non availability table and I want to only display the ones where the date is today or greater. I also what to order them by the employee_id.</p>
  
  <pre><code>&lt;div class="col-lg-6 col-sm-12 right"&gt;
        &lt;% @non_availabilities = NonAvailability.all %&gt;
        &lt;table class="table table-striped table-bordered table-hover"&gt;
          &lt;thead&gt;
          &lt;tr&gt;
            &lt;th class="col-md-2"&gt;Employee&lt;/th&gt;
            &lt;th class="col-md-2"&gt;Date&lt;/th&gt;
            &lt;th class="col-md-2"&gt;Time&lt;/th&gt;
            &lt;th class="col-md-2"&gt;Reason&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
        &lt;tbody&gt;
        &lt;% @non_availabilities.each do |non_availability| %&gt;
          &lt;tr&gt;
          &lt;td class="col-md-2"&gt;&lt;%= non_availability.employee.full_name %&gt;&lt;/td&gt;
          &lt;td class="col-md-2"&gt;&lt;%= non_availability.date %&gt;&lt;/td&gt;
          &lt;td class="col-md-2"&gt;&lt;%= non_availability.time %&gt;&lt;/td&gt;
          &lt;td class="col-md-2"&gt;&lt;%= non_availability.reason %&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;% end %&gt;
          &lt;/tbody&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>What is the syntax for this solution?</p>