Sha256: 6331b3486c761e0ed49658981d30cadad7c5c620c220dffca92ff7c84a50b98d

Contents?: true

Size: 696 Bytes

Versions: 15

Compression:

Stored size: 696 Bytes

Contents

<%#
# BelongsTo Index Partial

This partial renders a belongs_to relationship,
to be displayed on a resource's index 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/_index.html.erb
administrate-0.15.0 app/views/fields/belongs_to/_index.html.erb
administrate-0.14.0 app/views/fields/belongs_to/_index.html.erb
viniBaxterDesk-22.0.0 app/views/fields/belongs_to/_index.html.erb
viniBaxterDesk-0.21.0 app/views/fields/belongs_to/_index.html.erb
viniBaxterDesk-0.20.0 app/views/fields/belongs_to/_index.html.erb
viniBaxterDesk-0.14.0 app/views/fields/belongs_to/_index.html.erb
viniBaxterDesk-0.13.2 app/views/fields/belongs_to/_index.html.erb
viniBaxterDesk-0.13.1 app/views/fields/belongs_to/_index.html.erb
administrate-0.13.0 app/views/fields/belongs_to/_index.html.erb
administrate-0.12.0 app/views/fields/belongs_to/_index.html.erb
administrate-0.11.0 app/views/fields/belongs_to/_index.html.erb
semantic-administrate-0.10.1 app/views/fields/belongs_to/_index.html.erb
semantic-administrate-0.10.0 app/views/fields/belongs_to/_index.html.erb
administrate-0.10.0 app/views/fields/belongs_to/_index.html.erb