I'm trying to create an index.html.erb file that will list records from a table called events. I'm trying to select records for a particular day. starts_at is a datetime field in the table. For example, I'm trying to get all of the records for Monday of this week using:
<% @events = Event.where('starts_at.to_date = ?', DateTime.now.beginning_of_week.to_date) each do |event| %>
But, I don't get records when I should.
One thing it doesn't like is the each statement.
Thanks in advance for the help!