Class: Forms::SearchDateInputComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/forms/search_date_input_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(label:, form:, field:) ⇒ SearchDateInputComponent

Returns a new instance of SearchDateInputComponent.



4
5
6
7
8
9
10
# File 'app/components/forms/search_date_input_component.rb', line 4

def initialize(label:, form:, field:)
  @label = label
  @field = field
  @form = form
  @from_field = from_field
  @to_field = to_field
end

Instance Method Details

#from_fieldObject



12
13
14
# File 'app/components/forms/search_date_input_component.rb', line 12

def from_field
  "#{@field}_from_date".to_sym
end

#to_fieldObject



16
17
18
# File 'app/components/forms/search_date_input_component.rb', line 16

def to_field
  "#{@field}_to_date".to_sym
end