Sha256: 0aeb0a8fdfcaf3ed88b7dc989b5fbc8b3fd82a56120f7a800c4b48e4f90504b4

Contents?: true

Size: 829 Bytes

Versions: 3

Compression:

Stored size: 829 Bytes

Contents

<%#
# Polymorphic Show Partial

This partial renders a polymorphic 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::Polymorphic][1].
  A wrapper around the polymorphic belongs_to relationship
  pulled from the database.

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

<% if field.data %>
  <% if accessible_action?(field.data, :show) %>
    <%= link_to(
      field.display_associated_resource,
      [namespace, field.data],
      class: "text-blue-600 hover:text-blue-800 visited:text-purple-600"
    ) %>
  <% else %>
    <span class="text-gray-900">
      <%= field.display_associated_resource %>
    </span>
  <% end %>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
administrate_tailwind_theme-0.0.3 app/views/fields/polymorphic/_show.html.erb
administrate_tailwind_theme-0.0.2 app/views/fields/polymorphic/_show.html.erb
administrate_tailwind_theme-0.0.1 app/views/fields/polymorphic/_show.html.erb