Sha256: 9a64c5f3c39f70230efcde33b8758dd49a25bad2fe37a98d34aa227d69058499

Contents?: true

Size: 708 Bytes

Versions: 16

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 valid_action?(:show, field.attribute) %>
    <%= link_to(
      field.display_associated_resource,
      [namespace, field.data],
    ) %>
  <% else %>
    <%= field.display_associated_resource %>
  <% end %>
<% end %>

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
administrate-0.14.0 app/views/fields/polymorphic/_show.html.erb
viniBaxterDesk-22.0.0 app/views/fields/polymorphic/_show.html.erb
viniBaxterDesk-0.21.0 app/views/fields/polymorphic/_show.html.erb
viniBaxterDesk-0.20.0 app/views/fields/polymorphic/_show.html.erb
viniBaxterDesk-0.14.0 app/views/fields/polymorphic/_show.html.erb
viniBaxterDesk-0.13.2 app/views/fields/polymorphic/_show.html.erb
viniBaxterDesk-0.13.1 app/views/fields/polymorphic/_show.html.erb
administrate-0.13.0 app/views/fields/polymorphic/_show.html.erb
administrate-0.12.0 app/views/fields/polymorphic/_show.html.erb
administrate-0.11.0 app/views/fields/polymorphic/_show.html.erb
semantic-administrate-0.10.1 app/views/fields/polymorphic/_show.html.erb
semantic-administrate-0.10.0 app/views/fields/polymorphic/_show.html.erb
administrate-0.10.0 app/views/fields/polymorphic/_show.html.erb
semantic-administrate-0.1.1 app/views/fields/polymorphic/_show.html.erb
administrate-0.9.0 app/views/fields/polymorphic/_show.html.erb
semantic-administrate-0.1.0 app/views/fields/polymorphic/_show.html.erb