app/views/sent_messages/index.html.erb
<%= render :layout => '/application/header', :locals => {:title => 'Filter'} do %>
<%= form_tag(sent_messages_path, method: "get", class: "navbar-form", slack_username: "search-form") do %>
<div class="input-append">
<%= text_field_tag :slack_username, params[:slack_username], class: "filter-input", placeholder: "slack username" %>
<%= text_field_tag :sent_on, params[:sent_on], class: "filter-input", placeholder: "sent on" %>
<%= text_field_tag :message_body, params[:message_body], class: "filter-input", placeholder: "body" %>
<button class="button filter-button" type="submit"><i class="icon-search"></i>Filter</button>
</div>
<% end %>
<% end %>
<section class="main-content">
<%= render "flashes" -%>
<table>
<tr>
<th>Slack username</th>
<th>Sent on</th>
<th>Sent at</th>
<th>Message body</th>
<th>Error message</th>
</tr>
<% @sent_messages.each do |sent_message| %>
<tr>
<td><%= sent_message.slack_username %></td>
<td><%= sent_message.sent_on %></td>
<td><%= display_local_time_zone(sent_message) %></td>
<td><%= truncate(sent_message.message_body, length: 50, separator: ' ') %></td>
<td><%= sent_message.error_message %></td>
</tr>
<% end %>
<table>
<% if @sent_messages.empty? %>
<label>No matches found.</label>
<% end %>
<%= paginate(@sent_messages) %>
</section>