<%# # BelongsToSearch 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::BelongsToSearch. A wrapper around the belongs_to relationship pulled from the database. %> <% if field.resources.any? %> <% order = field.order_from_params(params.fetch(field.name, {})) %> <% page_number = params.fetch(field.name, {}).fetch(:page, nil) %> <%= render( "collection", collection_presenter: field.associated_collection(order), collection_field_name: field.name, page: page, resources: field.resources(page_number, order), table_title: field.name, ) %> <% if field.more_than_limit? %> <%= paginate field.resources(page_number), param_name: "#{field.name}[page]" %> <% end %> <% else %> <%= t("administrate.fields.has_many.none", default: "–") %> <% end %>