app/views/posts/index.html.erb
<h1>Posts</h1>
<h2>Daily (2 weeks)</h2>
<%= render partial: '/chart', locals: { chart_input_data: :chart_data } %>
<h2>Hourly (1 month)</h2>
<%= render partial: '/chart', locals: {discrete: true, chart_input_data: :perhour_chart_data } %>
<h2>Weekly (1 month)</h2>
<%= render partial: '/chart', locals: {discrete: true, chart_input_data: :perweekday_chart_data } %>
<h2>List of Posts (1 weeks)</h2>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th><%= sortable "post", "Post" %></th>
<th><%= sortable "user","User" %></th>
<th><%= sortable "text", "Text" %></th>
<th><%= sortable "ts", "Ts" %></th>
</tr>
</thead>
<tbody>
<% @posts.each do |post| %>
<tr>
<td><%= post.post_type %></td>
<td><%= post.user %></td>
<td><%= post.text %></td>
<td><%= post.ts %></td>
</tr>
<% end %>
</tbody>
</table>
<br>