Class: Layout::SearchComponent
- Inherits:
-
CommonComponent
- Object
- ViewComponent::Base
- CommonComponent
- Layout::SearchComponent
- Defined in:
- app/components/layout/search_component.rb
Overview
this class render an events search panel
Instance Method Summary collapse
-
#include_blank ⇒ Hash
make hash for include_blank.
-
#initialize(url:, turbo_frame:, text: true, date_range: true, scope: nil, blank: true, categories: [], editor: false, soldout: false) ⇒ SearchComponent
constructor
A new instance of SearchComponent.
Methods inherited from CommonComponent
#icon, #icon_text, #level, #level_item, #pagy, #turbo_yield
Methods included from ApplicationHelper
#fas_icon, #icon, #icon_text, #l_date, #l_long, #l_time, #notifications, #notify, #notify_status, #t_enum
Constructor Details
#initialize(url:, turbo_frame:, text: true, date_range: true, scope: nil, blank: true, categories: [], editor: false, soldout: false) ⇒ SearchComponent
Returns a new instance of SearchComponent.
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/components/layout/search_component.rb', line 26 def initialize(url:, turbo_frame:, text: true, date_range: true, scope: nil, blank: true, categories: [], editor: false, soldout: false) super @url = url @turbo_frame = turbo_frame @text = text @scope = scope @categories = categories @blank = blank @date_range = date_range @soldout = soldout @editor = editor end |
Instance Method Details
#include_blank ⇒ Hash
make hash for include_blank
42 43 44 45 46 47 48 |
# File 'app/components/layout/search_component.rb', line 42 def include_blank if @blank { include_blank: t(".all_category") } else {} end end |