<%# # Index This view is the template for the index page. It is responsible for rendering the search bar, header and pagination. It renders the `_table` partial to display details about the resources. ## Local variables: - `page`: An instance of [Administrate::Page::Collection][1]. Contains helper methods to help display a table, and knows which attributes should be displayed in the resource's table. - `resources`: An instance of `ActiveRecord::Relation` containing the resources that match the user's search criteria. By default, these resources are passed to the table partial to be displayed. - `search_term`: A string containing the term the user has searched for, if any. - `show_search_bar`: A boolean that determines if the search bar should be shown. [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection %> <% content_for(:title) do %> <%= display_resource_name(page.resource_name) %> <% end %> <% resource_icons = { 'account' => 'icon-building-4-line', 'user' => 'icon-user-follow-line', 'account_user' => 'icon-user-follow-line', 'agent_bot' => 'icon-robot-line', 'response_source' => 'icon-book-2-line', 'response_document' => 'icon-draft-line', 'response' => 'icon-reply-line' } current_icon = resource_icons[page.resource_name] || 'icon-apps-2-line' %>
<%= render( "collection", collection_presenter: page, collection_field_name: resource_name, page: page, resources: resources, table_title: "page-title" ) %> <%= paginate resources, param_name: '_page'%>