Sha256: c302f5a1fde2723fba96b40a7d5af9e40234ca009dc37061ca04acddfba15711

Contents?: true

Size: 1.27 KB

Versions: 5

Compression:

Stored size: 1.27 KB

Contents

<tr class="<%= (index % 2).zero? ? 'even' : 'odd' %> <%= row_class_mapper.call(item) %>">
  <% fields.each do |field, class_mapper, label, value_mapper| %>
    <td class="align-middle <%= class_mapper.call(item) %>">
      <% if component.secret_field?(field) %>
        <%= controller.helpers.render partial: 'active_element/components/secret/field',
                                      locals: { secret: value_mapper.call(item), label: label } %>
      <% else %>
        <%= controller.helpers.render partial: 'active_element/components/table/field',
                                      locals: { value: value_mapper.call(item) } %>
      <% end %>
    </td>
  <% end %>

  <% if show %>
    <td class="<%= "#{class_name}-show" %> action-column text-end">
      <%= active_element.component.show_button(item, show, tooltip: true, class: 'btn-sm') %>
    </td>
  <% end %>

  <% if edit %>
    <td class="<%= "#{class_name}-edit" %> action-column text-end">
      <%= active_element.component.edit_button(item, show, tooltip: true, class: 'btn-sm') %>
    </td>
  <% end %>

  <% if destroy %>
    <td class="<%= "#{class_name}-destroy" %> action-column text-end">
      <%= active_element.component.destroy_button(item, destroy, tooltip: true, class: 'btn-sm') %>
    </td>
  <% end %>
</tr>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_element-0.0.19 app/views/active_element/components/table/_collection_row.html.erb
active_element-0.0.18 app/views/active_element/components/table/_collection_row.html.erb
active_element-0.0.17 app/views/active_element/components/table/_collection_row.html.erb
active_element-0.0.16 app/views/active_element/components/table/_collection_row.html.erb
active_element-0.0.15 app/views/active_element/components/table/_collection_row.html.erb