Sha256: 7bdb0d5260407437c73c3b63ae7ce0f05c1faa5cdfd90a06375585a37851157f

Contents?: true

Size: 824 Bytes

Versions: 6

Compression:

Stored size: 824 Bytes

Contents

<%#
# LazyBelongsTo 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::LazyBelongsTo][1].
  A wrapper around the [Administrate::Field::BelongsTo][2] field

[1]: http://www.rubydoc.info/gems/administrate-field-lazy_belongs_to/Administrate/Field/LazyBelongsTo
[2]: 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

6 entries across 6 versions & 1 rubygems

Version Path
administrate-field-lazy_belongs_to-0.2.0 app/views/fields/lazy_belongs_to/_show.html.erb
administrate-field-lazy_belongs_to-0.1.4 app/views/fields/lazy_belongs_to/_show.html.erb
administrate-field-lazy_belongs_to-0.1.3 app/views/fields/lazy_belongs_to/_show.html.erb
administrate-field-lazy_belongs_to-0.1.2 app/views/fields/lazy_belongs_to/_show.html.erb
administrate-field-lazy_belongs_to-0.1.1 app/views/fields/lazy_belongs_to/_show.html.erb
administrate-field-lazy_belongs_to-0.1.0 app/views/fields/lazy_belongs_to/_show.html.erb