Sha256: 304a05dc9f8e643d90731e71444b9ce514756a73ee2280836d3331d16a638aa0

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

<%= content_for :title, resource.display_name(@record) %>

<header class="header">
  <h1>
    <%= link_to resource.friendly_name.pluralize, resource.index_path %>
    /
    <%= resource.display_name(@record) %>
  </h1>

  <div class="actions">
    <% resource.member_actions.each do |action| %>
      <%= instance_exec(@record, &action) %>
    <% end %>
    <%= link_to "Edit", resource.edit_path(@record), class: "btn btn-secondary" %>
    <%= button_to "Delete", resource.show_path(@record), method: :delete, data: { turbo_confirm: "Are you sure?" }, class: "btn btn-danger" %>
  </div>
</header>

<div class="table-scroll">
  <table>
    <tbody>
    <% resource.attributes.values.each do |attribute| %>
      <% next if attribute.field.nil? %>
      <% next unless attribute.field.visible?(action_name) %>

      <tr>
        <th class="label">
          <%= attribute.field.options.label || attribute.name.to_s.titleize %>
        </th>

        <td>
          <%= render partial: attribute.field.to_partial_path("show"), locals: { field: attribute.field, record: @record, resource: resource } %>
        </td>
      </tr>
    <% end %>
    </tbody>
  </table>
</div>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
madmin-2.0.0 app/views/madmin/application/show.html.erb