title: Rails 4: Render today's events
body: <p>I am not sure how to do this. I am currently using:    </p>
  
  <pre><code>    &lt;% @events.each do |event| %&gt;
          &lt;li&gt;&lt;%= link_to event.group.name, event %&gt;
          &lt;%= event.start_time %&gt;
      &lt;% end %&gt;
  </code></pre>
  
  <p>Obviously, this is rendering EVERY event. Can I make some kind of  statement to render the events for JUST today? </p>
  
  <p>The above code is in the view. Is it a better idea to render the events from the controller? Or is it fine in the view?</p>
  
  <p>EDIT: 
  Wow, thanks for all the help guys! But, bear with me as I am a rails rookie. So I have changed my controller to this (based off of @Triveni Badgujar's answer:</p>
  
  <pre><code>  def home
      @resources = Resource.all
      @events = Event.where('DATE(created_at)= ?', Date.today)
      @homeworks = Homework.all
    end 
  </code></pre>
  
  <p>This code however, has not had an affect on my home.html.erb view page. It is still showing ALL events instead of today's. 
  Thanks again!</p>