Class: Www::TowelWarmerFiltersComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Www::TowelWarmerFiltersComponent
- Includes:
- TowelWarmerFilterSlugs
- Defined in:
- app/components/www/towel_warmer_filters_component.rb
Overview
Www::TowelWarmerFiltersComponent
Renders the filter bar for towel warmer product grid with SEO-friendly URLs.
Uses a Stimulus controller to build path-based URLs when filters change.
URL Structure: /towel-warmer/finish/style/connection/mounting/size
Constant Summary
Constants included from TowelWarmerFilterSlugs
TowelWarmerFilterSlugs::COMPOSITE_FINISH_SLUGS, TowelWarmerFilterSlugs::CONNECTION_LABELS, TowelWarmerFilterSlugs::CONNECTION_SLUGS, TowelWarmerFilterSlugs::FINISH_SLUGS, TowelWarmerFilterSlugs::MOUNTING_LABELS, TowelWarmerFilterSlugs::MOUNTING_SLUGS, TowelWarmerFilterSlugs::RANSACK_TO_SLUG, TowelWarmerFilterSlugs::SIZE_LABELS, TowelWarmerFilterSlugs::SIZE_SLUGS, TowelWarmerFilterSlugs::SLUG_TO_RANSACK, TowelWarmerFilterSlugs::STYLE_LABELS, TowelWarmerFilterSlugs::STYLE_SLUGS
Instance Attribute Summary collapse
-
#active_filters ⇒ Object
readonly
Returns the value of attribute active_filters.
-
#connection_options ⇒ Object
readonly
Returns the value of attribute connection_options.
-
#current_sort ⇒ Object
readonly
Returns the value of attribute current_sort.
-
#finish_options ⇒ Object
readonly
Returns the value of attribute finish_options.
-
#mounting_options ⇒ Object
readonly
Returns the value of attribute mounting_options.
-
#size_options ⇒ Object
readonly
Returns the value of attribute size_options.
-
#sort_options ⇒ Object
readonly
Returns the value of attribute sort_options.
-
#style_options ⇒ Object
readonly
Returns the value of attribute style_options.
Instance Method Summary collapse
-
#initialize(finish_options:, style_options:, connection_options:, mounting_options:, size_options:, sort_options:, active_filters: {}, current_sort: '') ⇒ TowelWarmerFiltersComponent
constructor
A new instance of TowelWarmerFiltersComponent.
Methods included from TowelWarmerFilterSlugs
available_filter_counts, build_filter_path, filter_options_with_slugs, parse_filter_segments, size_filter_counts
Methods inherited from ApplicationComponent
#cms_link, #fetch_or_fallback, #image_asset_tag, #image_tag, #number_to_currency, #number_with_delimiter, #post_path, #post_url, #strip_tags
Constructor Details
#initialize(finish_options:, style_options:, connection_options:, mounting_options:, size_options:, sort_options:, active_filters: {}, current_sort: '') ⇒ TowelWarmerFiltersComponent
Returns a new instance of TowelWarmerFiltersComponent.
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 42 def initialize(finish_options:, style_options:, connection_options:, mounting_options:, size_options:, sort_options:, active_filters: {}, current_sort: '') @finish_options = @style_options = @connection_options = @mounting_options = @size_options = @sort_options = @active_filters = active_filters || {} @current_sort = current_sort.to_s super() end |
Instance Attribute Details
#active_filters ⇒ Object (readonly)
Returns the value of attribute active_filters.
28 29 30 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 28 def active_filters @active_filters end |
#connection_options ⇒ Object (readonly)
Returns the value of attribute connection_options.
28 29 30 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 28 def @connection_options end |
#current_sort ⇒ Object (readonly)
Returns the value of attribute current_sort.
28 29 30 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 28 def current_sort @current_sort end |
#finish_options ⇒ Object (readonly)
Returns the value of attribute finish_options.
28 29 30 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 28 def @finish_options end |
#mounting_options ⇒ Object (readonly)
Returns the value of attribute mounting_options.
28 29 30 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 28 def @mounting_options end |
#size_options ⇒ Object (readonly)
Returns the value of attribute size_options.
28 29 30 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 28 def @size_options end |
#sort_options ⇒ Object (readonly)
Returns the value of attribute sort_options.
28 29 30 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 28 def @sort_options end |
#style_options ⇒ Object (readonly)
Returns the value of attribute style_options.
28 29 30 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 28 def @style_options end |