mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-21 19:22:18 -05:00
12 lines
450 B
Ruby
12 lines
450 B
Ruby
class Components::NumericInputRow < Components::InputRow
|
|
def initialize(form:, attribute:, label:, unit: nil, help: nil, options: {})
|
|
@unit = unit
|
|
super(form: form, attribute: attribute, label: label, help: help, options: options)
|
|
end
|
|
|
|
def input_element
|
|
raw @form.number_field(@attribute, {class: "form-control"}.merge(@options)) # rubocop:disable Rails/OutputSafety
|
|
span(class: "input-group-text") { @unit } if @unit
|
|
end
|
|
end
|