Module: Components::FilterHelper
- Defined in:
- app/helpers/components/filter_helper.rb
Instance Method Summary collapse
- #filter_icon(&block) ⇒ Object
- #list_item(value:, name:, selected:) ⇒ Object
- #render_filter(items, **options, &block) ⇒ Object
Instance Method Details
#filter_icon(&block) ⇒ Object
2 3 4 |
# File 'app/helpers/components/filter_helper.rb', line 2 def filter_icon(&block) content_for :filter_icon, capture(&block), flush: true end |
#list_item(value:, name:, selected:) ⇒ Object
13 14 15 |
# File 'app/helpers/components/filter_helper.rb', line 13 def list_item(value:, name:, selected:) "#{name}" end |
#render_filter(items, **options, &block) ⇒ Object
6 7 8 9 10 11 |
# File 'app/helpers/components/filter_helper.rb', line 6 def render_filter(items, **, &block) content_for :filter_icon, "", flush: true content = capture(&block) if block input_class = content_for?(:filter_icon) ? "pl-1" : "" render "components/ui/filter", items: items, options: , input_class: input_class, content: content end |