Class: Components::NumericInputRow
- Inherits:
-
InputRow
- Object
- InputRow
- Components::NumericInputRow
- Defined in:
- app/components/numeric_input_row.rb
Instance Method Summary collapse
-
#initialize(form:, attribute:, label:, unit: nil, help: nil, options: {}) ⇒ NumericInputRow
constructor
A new instance of NumericInputRow.
- #input_element ⇒ Object
Constructor Details
#initialize(form:, attribute:, label:, unit: nil, help: nil, options: {}) ⇒ NumericInputRow
Returns a new instance of NumericInputRow.
2 3 4 5 |
# File 'app/components/numeric_input_row.rb', line 2 def initialize(form:, attribute:, label:, unit: nil, help: nil, options: {}) @unit = unit super(form: form, attribute: attribute, label: label, help: help, options: ) end |
Instance Method Details
#input_element ⇒ Object
7 8 9 10 |
# File 'app/components/numeric_input_row.rb', line 7 def input_element raw @form.number_field(@attribute, {class: "form-control"}.merge()) # rubocop:disable Rails/OutputSafety span(class: "input-group-text") { @unit } if @unit end |