<% yield_name = "table_headers_#{model}_#{rand(100)}" %> <% content_for yield_name do %> <% if controller.respond_to?(:bulk) %> <%= check_box_tag "action-toggle", "", false, :class => "action-toggle" %> <% end %> <% headers.each do |header| %> <%= header %> <% end %> <%= Typus::I18n.t('Actions') %> <% end %> <%= yield yield_name %> <% items.each do |item| %> <% if controller.respond_to?(:bulk) %> <% end %> <% table_fields_for_item(item, fields).each do |field| %> <% end %> <% end %>
<%= check_box_tag "selected_item_ids[]", item.id, false, :class => "action-select" %> <%= field %>
<% table_actions(model, item, association_name).each do |action| %> <% html_options = action[:options] || {} %> <%= link_to url_for(action[:url]), html_options.merge(class: 'btn btn-small') do %> <%= action[:message] %> <% end %> <% end %>