<h2>Metrics</h2>

<%= form_for(@metric_search, :url => cohortly_metrics_path, :html => {
:method =>:get }) do |f| %>
  <div class="field">
    <%= f.label :user_id %>
    <%= f.text_field :user_id %>
  </div>
  <%= render :partial => 'cohortly/metrics/tags' %>
  <%= f.submit "filter" %>
<% end %>

<% url_gen = lambda {|page| cohortly_metrics_path({:cohortly_metric => params[:cohortly_metric], :page => page}) } %>
<%= render :partial => 'pagination', 
             :object => @metrics, 
             :locals => { :url_gen => url_gen} %>
<table class="hor-zebra">
  <tr>
    <th>User</th>
    <th>Username</th>
    <th>Time</th>
    <th>Controller</th>
    <th>Action</th>
    <th>Tags</th>
  </tr>
  <%= render :collection => @metrics, :partial => 'metric' %>
</table>

<%= render :partial => 'pagination', 
           :object => @metrics, 
           :locals => { :url_gen => url_gen} %>