Class: Arara::Tags::TextField
- Inherits:
-
ActionView::Helpers::Tags::Base
- Object
- ActionView::Helpers::Tags::Base
- Arara::Tags::TextField
- Includes:
- ActionView::Helpers::Tags::Placeholderable
- Defined in:
- app/components/arara/tags/text_field.rb
Overview
:nodoc:
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.field_type ⇒ Object
20 21 22 |
# File 'app/components/arara/tags/text_field.rb', line 20 def field_type @field_type ||= name.split("::").last.sub("Field", "").downcase end |
Instance Method Details
#render ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/components/arara/tags/text_field.rb', line 10 def render = @options.stringify_keys ["size"] = ["maxlength"] unless .key?("size") ["type"] ||= field_type ["value"] = .fetch("value") { value_before_type_cast } unless field_type == "file" add_default_name_and_id() @template_object.template.render(Arara::TextFieldComponent, .symbolize_keys) end |