Sha256: 0171d62f60b27311e9c3cfc0e45a14248d6fa75bd4fdce8f2704abd9d701894f

Contents?: true

Size: 694 Bytes

Versions: 15

Compression:

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

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
administrate-0.16.0 app/views/fields/belongs_to/_show.html.erb
administrate-0.15.0 app/views/fields/belongs_to/_show.html.erb
administrate-0.14.0 app/views/fields/belongs_to/_show.html.erb
viniBaxterDesk-22.0.0 app/views/fields/belongs_to/_show.html.erb
viniBaxterDesk-0.21.0 app/views/fields/belongs_to/_show.html.erb
viniBaxterDesk-0.20.0 app/views/fields/belongs_to/_show.html.erb
viniBaxterDesk-0.14.0 app/views/fields/belongs_to/_show.html.erb
viniBaxterDesk-0.13.2 app/views/fields/belongs_to/_show.html.erb
viniBaxterDesk-0.13.1 app/views/fields/belongs_to/_show.html.erb
administrate-0.13.0 app/views/fields/belongs_to/_show.html.erb
administrate-0.12.0 app/views/fields/belongs_to/_show.html.erb
administrate-0.11.0 app/views/fields/belongs_to/_show.html.erb
semantic-administrate-0.10.1 app/views/fields/belongs_to/_show.html.erb
semantic-administrate-0.10.0 app/views/fields/belongs_to/_show.html.erb
administrate-0.10.0 app/views/fields/belongs_to/_show.html.erb