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 @options[:size] = @options[:max_length] unless @options.key?(:size) @options[:type] ||= field_type @options[:value] = @options.fetch(:value) { value_before_type_cast } unless field_type == "file" json.set!(sanitized_key) do add_default_name_and_id(@options) input_props(@options) end end |