how to find attendance by date range in rails?
<table>
<thead>
<tr>
<th>Name</th>
<th>Total Present</th>
<th>Total Absent</th>
</tr>
</thead>
<tbody>
<% @manpowers.each do |manpower| %>
<tr>
<td><%= manpower.name %></td>
<td><%= manpower.attendance.date_between(from_date, to_date).present.count %></td>
<td><%= manpower.attendance.date_between(from_date, to_date).absent.count %></td>
</tr>
<% end %>
</tbody>
</table>