Class: Www::TowelWarmerFiltersComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Www::TowelWarmerFiltersComponent
- Includes:
- Models::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}
Usage:
<%# Basic usage %>
<%= render Www::TowelWarmerFiltersComponent.new(
finish_options: @finish_options,
style_options: @style_options,
connection_options: @connection_options,
mounting_options: @mounting_options,
size_options: @size_options,
sort_options: @sort_options,
active_filters: @active_filters
) %>
Constant Summary
Constants included from Models::TowelWarmerFilterSlugs
Models::TowelWarmerFilterSlugs::COMPOSITE_FINISH_SLUGS, Models::TowelWarmerFilterSlugs::CONNECTION_LABELS, Models::TowelWarmerFilterSlugs::CONNECTION_SLUGS, Models::TowelWarmerFilterSlugs::FINISH_SLUGS, Models::TowelWarmerFilterSlugs::MOUNTING_LABELS, Models::TowelWarmerFilterSlugs::MOUNTING_SLUGS, Models::TowelWarmerFilterSlugs::RANSACK_TO_SLUG, Models::TowelWarmerFilterSlugs::SIZE_LABELS, Models::TowelWarmerFilterSlugs::SIZE_SLUGS, Models::TowelWarmerFilterSlugs::SLUG_TO_RANSACK, Models::TowelWarmerFilterSlugs::STYLE_LABELS, Models::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 Models::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.
29 30 31 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 29 def active_filters @active_filters end |
#connection_options ⇒ Object (readonly)
Returns the value of attribute connection_options.
29 30 31 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 29 def @connection_options end |
#current_sort ⇒ Object (readonly)
Returns the value of attribute current_sort.
29 30 31 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 29 def current_sort @current_sort end |
#finish_options ⇒ Object (readonly)
Returns the value of attribute finish_options.
29 30 31 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 29 def @finish_options end |
#mounting_options ⇒ Object (readonly)
Returns the value of attribute mounting_options.
29 30 31 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 29 def @mounting_options end |
#size_options ⇒ Object (readonly)
Returns the value of attribute size_options.
29 30 31 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 29 def @size_options end |
#sort_options ⇒ Object (readonly)
Returns the value of attribute sort_options.
29 30 31 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 29 def @sort_options end |
#style_options ⇒ Object (readonly)
Returns the value of attribute style_options.
29 30 31 |
# File 'app/components/www/towel_warmer_filters_component.rb', line 29 def @style_options end |