Module: StimulusPlumbers::Form::Fields::Inputs::Password

Included in:
Builder
Defined in:
lib/stimulus_plumbers/form/fields/inputs/password.rb

Instance Method Summary collapse

Instance Method Details

#password_field(attribute, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/stimulus_plumbers/form/fields/inputs/password.rb', line 8

def password_field(attribute, options = {})
  revealable = options.delete(:revealable) { false }
  html_options = merge_html_options(theme.resolve(:form_field_input), options)
  if revealable
    render_revealable_password(false) do
      super(attribute, merge_html_options(html_options, { data: { input_formatter_target: "input" } }))
    end
  else
    super(attribute, html_options)
  end
end