<div class="form">
    <fieldset>
        <h3 class="fieldset-heading"><%= header_text %></h3>

        <table class="table table-striped">
          <thead>
            <tr>
              <% names.each do |name| %>
                <th><%= model_class.fields[name].display_name %></th>
              <% end %>

              <th></th>
            </tr>
          </thead>

          <tbody>
            <% records.each do |record| %>
              <tr>
                <% names.each do |name| %>

                  <td>
                    <%= model_class.fields[name].get_value record %>
                  </td>

                <% end %>

                <td class="actions">
                  <%= link_to 'Edit/View', event_path(record.event), class: 'btn btn-default btn-xs' %>
                  <%= link_to 'Destroy', record, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger btn-xs' %>
                </td>

              </tr>
            <% end %>
          </tbody>
        </table>

        <%= link_to create_button_text, new_path, class: 'btn btn-primary' %>
    </fieldset>
</div>