Sha256: 56a3fcf202d646b4bb1db66d9a697d6d67284bf8ca221b467026f3bc00bc0239

Contents?: true

Size: 946 Bytes

Versions: 6

Compression:

Stored size: 946 Bytes

Contents

<%#
# HasMany Show Partial

This partial renders a has_many relationship,
to be displayed on a resource's show page.

By default, the relationship is rendered
as a table of the first few associated resources.
The columns of the table are taken
from the associated resource class's dashboard.

## Local variables:

- `field`:
  An instance of [Administrate::Field::HasMany][1].
  Contains methods to help display a table of associated resources.

[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/HasMany
%>

<% if field.resources.any? %>
  <%= render(
    "collection",
    collection_presenter: field.associated_collection,
    resources: field.resources(params[field.name]),
    table_title: field.name
  ) %>

  <% if field.more_than_limit? %>
    <%= paginate field.resources(params[field.name]), param_name: "#{field.name}" %>
  <% end %>

<% else %>
  <%= t("administrate.fields.has_many.none", default: "–") %>
<% end %>

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
administrate-0.10.0 app/views/fields/has_many/_show.html.erb
semantic-administrate-0.1.1 app/views/fields/has_many/_show.html.erb
administrate-0.9.0 app/views/fields/has_many/_show.html.erb
semantic-administrate-0.1.0 app/views/fields/has_many/_show.html.erb
administrate-0.8.1 app/views/fields/has_many/_show.html.erb
administrate-0.8.0 app/views/fields/has_many/_show.html.erb