Sha256: ac5142b78d52850107f295096c4b4e10ee45a51ed892b60fe5ebaf9cc00c53d6

Contents?: true

Size: 802 Bytes

Versions: 6

Compression:

Stored size: 802 Bytes

Contents

<%#
# BelongsTo Show Partial

This partial renders a belongs_to relationship,
to be displayed on a resource's show page.

By default, the relationship is rendered as a link to the associated object.

## Local variables:

- `field`:
  An instance of [Administrate::Field::BelongsTo][1].
  A wrapper around the belongs_to relationship pulled from the database.

[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/BelongsTo
%>

<% if field.data %>
  <% if accessible_action?(field.data, :show) %>
    <div class="bg-gray-50 p-3 rounded-md shadow-sm">
      <%= link_to(field.display_associated_resource, [namespace, field.data]) %>
    </div>
  <% else %>
    <div class="bg-gray-50 p-3 rounded-md shadow-sm">
      <%= field.display_associated_resource %>
    </div>
  <% end %>
<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
administrate_tailwind_theme-0.0.6 app/views/fields/belongs_to/_show.html.erb
administrate_tailwind_theme-0.0.5 app/views/fields/belongs_to/_show.html.erb
administrate_tailwind_theme-0.0.4 app/views/fields/belongs_to/_show.html.erb
administrate_tailwind_theme-0.0.3 app/views/fields/belongs_to/_show.html.erb
administrate_tailwind_theme-0.0.2 app/views/fields/belongs_to/_show.html.erb
administrate_tailwind_theme-0.0.1 app/views/fields/belongs_to/_show.html.erb