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