Class: Layout::SearchComponent

Inherits:
CommonComponent show all
Defined in:
app/components/layout/search_component.rb

Overview

this class render an events search panel

Instance Method Summary collapse

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.

Parameters:

  • opts (Hash)

    to generate content

  • [String] (Hash)

    a customizable set of options

  • [string] (Hash)

    a customizable set of options



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_blankObject



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