Sha256: bf22807d0a85f5bd88bf3c5d4b3624967e8f96c76a53014c53655f081d02aeae

Contents?: true

Size: 1.23 KB

Versions: 12

Compression:

Stored size: 1.23 KB

Contents

<% yield_name = "table_headers_#{model}" %>

<% content_for yield_name do %>
  <thead>
    <tr>
      <% if controller.respond_to?(:bulk) %>
        <th><%= check_box_tag "action-toggle", "", false, :class => "action-toggle" %></th>
      <% end %>
      <% headers.each do |header| %>
        <th><%= header %></th>
      <% end %>
    </tr>
  </thead>
<% end %>

<table>

  <%= yield yield_name %>

  <% items.each do |item| %>
    <tr class="<%= cycle('even', 'odd') %>" id="<%= dom_id(item) %>">
      <% if controller.respond_to?(:bulk) %>
        <td width="16">
          <%= check_box_tag "selected_item_ids[]", item.id, false, :class => "action-select" %>
        </td>
      <% end %>
      <% table_fields_for_item(item, fields).each_with_index do |field, index| %>
        <td>
          <%= field %>
          <% if index.zero? %>
            <div class="actions">
                <% table_actions(model, item, association_name).each_with_index do |action, index| %>
                  <%= "/" unless index.zero? %>
                  <%= link_to action[:message], action[:url], action[:options] %>
                <% end %>
            </div>
          <% end %>
        </td>
      <% end %>
    </tr>
  <% end %>

  <%= yield yield_name %>

</table>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
typus-3.1.6 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.5 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.4 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.3 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.2 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.1 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.0 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.0.rc19 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.0.rc18 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.0.rc17 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.0.rc16 app/views/helpers/admin/resources/_table.html.erb
typus-3.1.0.rc15 app/views/helpers/admin/resources/_table.html.erb