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 ⇒ Object
-
#initialize(url:, turbo_frame:, text: true, date_range: true, scope: nil, blank: true, categories: []) ⇒ 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: []) ⇒ SearchComponent
Returns a new instance of SearchComponent.
19 20 21 22 23 24 25 26 27 28 |
# File 'app/components/layout/search_component.rb', line 19 def initialize(url:, turbo_frame:, text: true, date_range: true, scope: nil, blank: true, categories: []) super @url = url @turbo_frame = turbo_frame @text = text @scope = scope @categories = categories @blank = blank @date_range = date_range end |
Instance Method Details
#include_blank ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/components/layout/search_component.rb', line 30 def include_blank if @blank { include_blank: t(".all_category") } else {} end end |