Class: Yattho::Forms::TextField
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Yattho::Forms::TextField
- Defined in:
- lib/yattho/forms/text_field.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes included from ActsAsComponent
Instance Method Summary collapse
- #auto_check_authenticity_token ⇒ Object
-
#initialize(input:) ⇒ TextField
constructor
A new instance of TextField.
Methods inherited from BaseComponent
#content, inherited, #input?, #perform_render, #render?, #to_component, #type
Methods included from ActsAsComponent
#compile!, extended, #renders_templates
Methods included from ClassNameHelper
Constructor Details
#initialize(input:) ⇒ TextField
Returns a new instance of TextField.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/yattho/forms/text_field.rb', line 9 def initialize(input:) @input = input @field_wrap_arguments = { class: class_names( "FormControl-input-wrap", Yattho::Forms::Dsl::Input::SIZE_MAPPINGS[@input.size], 'FormControl-input-wrap--trailingAction': @input., 'FormControl-input-wrap--leadingVisual': @input.leading_visual? ), hidden: @input.hidden? } end |
Instance Method Details
#auto_check_authenticity_token ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/yattho/forms/text_field.rb', line 24 def auto_check_authenticity_token return @auto_check_authenticity_token if defined?(@auto_check_authenticity_token) @auto_check_authenticity_token = if @input.auto_check_src @view_context.form_authenticity_token( form_options: { method: :post, action: @input.auto_check_src } ) end end |