% # locals: { # table: "instance of Plutonium::UI::Builder::Collection" # } resource_class = table.resource_class resources = table.records.to_a record_actions = table.actions.collection_record_actions search_object = table.search_object %>
<%= sort_link(search_object, :id, '#', class: "text-decoration-none") %> | <% table.fields.each do |name, field| %><% if resource_class.ransortable_attributes.include? name.to_s %> <%= sort_link(search_object, name, field.label, class: "text-decoration-none") %> <% else %> <%= field.label %> <% end %> | <% end %>Actions |
---|---|---|
<% if policy(resource).show? %> <%= link_to resource.to_param, adapt_route_args(resource), class: "text-decoration-none" %> <% else %> <%= resource.to_param %> <% end %> | <% table.fields.each do |name, field| %> <% options = field.options max_width = options.delete :pu_max_width %><%= field.render self, resource %> | <% end %><%= render partial: 'table_actions', locals: { actions: record_actions.permitted_for(policy(resource)), resource: resource } %> |