I'm having a tough time figuring out how to make a helper for my array that outputs an html table, here is what my array looks like.
[
{"day"=>1.0, "hour"=>14.0, "count"=>818.0},
{"day"=>1.0, "hour"=>15.0, "count"=>366.0},
{"day"=>1.0, "hour"=>16.0, "count"=>1246.0},
{"day"=>1.0, "hour"=>17.0, "count"=>116.0},
{"day"=>1.0, "hour"=>18.0, "count"=>434.0},
{"day"=>1.0, "hour"=>19.0, "count"=>123.0},
{"day"=>1.0, "hour"=>20.0, "count"=>442.0},
]
Additionally this is what my table should look like, how can I for each day output its name in the header, then for each hour of each hour of each day output the count value from my hash? I'm having a hard time picturing how to iterate over these values.
<table>
<tr>
<th style="width:8em"></th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
<th>Saturday</th>
<th>Sunday</th>
</tr>
<tr>
<th scope="row">00:00–01:00</th>
<td>468</td>
<td>2721</td>
<td>848</td>
<td>3127</td>
<td>803</td>
<td>1970</td>
<td>2673</td>
</tr>
<tr>
<th scope="row">01:00–02:00</th>
<td>468</td>
<td>2721</td>
<td>848</td>
<td>3127</td>
<td>803</td>
<td>1970</td>
<td>2673</td>
</tr>
<!-- remaining hours of the day for each day continue... -->
</table>
Any help at all would be really really appreciated.