%# # Filters This partial is used on the `index` page to display available filters for a collection of 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. [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection %> <% # Get the dashboard class name from the resource name resource_name = page.resource_name.classify dashboard_class_name = "#{resource_name}Dashboard" dashboard_class = dashboard_class_name.constantize # Get the current filter if any current_filter = nil if params[:search] && params[:search].include?(':') current_filter = params[:search].split(':').first end %> <% if dashboard_class.const_defined?(:COLLECTION_FILTERS) && !dashboard_class::COLLECTION_FILTERS.empty? %>