Sha256: 78e494d7654b6d76c8a2a23e5894448e68aed2fc345014a46731b23d0430229b
Contents?: true
Size: 677 Bytes
Versions: 29
Compression:
Stored size: 677 Bytes
Contents
# frozen_string_literal: true class Avo::FiltersComponent < ViewComponent::Base include Avo::ApplicationHelper def initialize(filters: [], resource: nil, applied_filters: [], parent_model: nil) @filters = filters @resource = resource @applied_filters = applied_filters @parent_model = parent_model end def render? @filters.present? end def reset_path # If come from a association page if @parent_model.present? helpers.related_resources_path(@parent_model, @parent_model, filters: nil, keep_query_params: true) else helpers.resources_path(resource: @resource, filters: nil, keep_query_params: true) end end end
Version data entries
29 entries across 29 versions & 1 rubygems