Class: FormProps::Inputs::TextField
- Includes:
- ActionView::Helpers::Tags::Placeholderable
- Defined in:
- lib/form_props/inputs/text_field.rb
Direct Known Subclasses
ColorField, DatetimeField, EmailField, FileField, HiddenField, NumberField, PasswordField, SearchField, TelField, UrlField
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from FormProps::Inputs::Base
Instance Method Details
#render ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/form_props/inputs/text_field.rb', line 10 def render [:size] = [:max_length] unless .key?(:size) [:type] ||= field_type [:value] = .fetch(:value) { value_before_type_cast } unless field_type == "file" json.set!(sanitized_key) do add_default_name_and_id() input_props() end end |