Sha256: 9f08d917cfc0a0c83fd5dc500ab8421e1e04f5a7f51fa3aa9695f5d51be62bde

Contents?: true

Size: 995 Bytes

Versions: 13

Compression:

Stored size: 995 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,
    table_title: field.name
  ) %>

  <% if field.more_than_limit? %>
    <span>
      <%= t(
        'administrate.fields.has_many.more',
        count: field.limit,
        total_count: field.data.count,
      ) %>
    </span>
  <% end %>

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

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
viniBaxter-spa-nested_has_many-300.0.6 app/views/fields/nested_has_many/_show_old.html.erb
viniBaxter-spa-nested_has_many-300.0.5 app/views/fields/nested_has_many/_show_old.html.erb
viniBaxter-spa-nested_has_many-300.0.4 app/views/fields/nested_has_many/_show_old.html.erb
viniBaxter-spa-nested_has_many-300.0.2 app/views/fields/nested_has_many/_show_old.html.erb
viniBaxter-spa-nested_has_many-300.0.1 app/views/fields/nested_has_many/_show_old.html.erb
viniBaxter-spa-nested_has_many-5.4.0 app/views/fields/nested_has_many/_show_old.html.erb
viniBaxter-spa-nested_has_many-5.0.1 app/views/fields/nested_has_many/_show_old.html.erb
viniBaxter-spa-nested_has_many-5.0.0 app/views/fields/nested_has_many/_show_old.html.erb
administrate-field-nested_has_many-1.3.0 app/views/fields/nested_has_many/_show_old.html.erb
viniBaxter-spa-nested_has_many-4.0.0 app/views/fields/nested_has_many/_show_old.html.erb
viniBaxter-spa-nested_has_many-3.0.0 app/views/fields/nested_has_many/_show_old.html.erb
viniBaxter-spa-nested_has_many-2.0.0 app/views/fields/nested_has_many/_show_old.html.erb
administrate-field-nested_has_many-1.2.0 app/views/fields/nested_has_many/_show_old.html.erb