Class: Forms::SearchDateInputComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Forms::SearchDateInputComponent
- Defined in:
- app/components/forms/search_date_input_component.rb
Instance Method Summary collapse
- #from_field ⇒ Object
-
#initialize(label:, form:, field:) ⇒ SearchDateInputComponent
constructor
A new instance of SearchDateInputComponent.
- #to_field ⇒ Object
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_field ⇒ Object
12 13 14 |
# File 'app/components/forms/search_date_input_component.rb', line 12 def from_field "#{@field}_from_date".to_sym end |
#to_field ⇒ Object
16 17 18 |
# File 'app/components/forms/search_date_input_component.rb', line 16 def to_field "#{@field}_to_date".to_sym end |