Sha256: 76146d9266f455995902438975f1ebb376905614e97f223c4cbb009d9bffecaf

Contents?: true

Size: 708 Bytes

Versions: 7

Compression:

Stored size: 708 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],
    ) %>
  <% else %>
    <%= field.display_associated_resource %>
  <% end %>
<% end %>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
administrate-1.0.0.beta3 app/views/fields/polymorphic/_show.html.erb
administrate-1.0.0.beta2 app/views/fields/polymorphic/_show.html.erb
administrate-1.0.0.beta1 app/views/fields/polymorphic/_show.html.erb
administrate-0.20.1 app/views/fields/polymorphic/_show.html.erb
administrate-0.20.0 app/views/fields/polymorphic/_show.html.erb
administrate-0.19.0 app/views/fields/polymorphic/_show.html.erb
administrate-0.18.0 app/views/fields/polymorphic/_show.html.erb