Module: SimpleFormWithClientValidation::Components::Placeholders

Included in:
Inputs::Base
Defined in:
lib/simple_form_with_client_validation/components/placeholders.rb

Overview

Needs to be enabled in order to do automatic lookups.

Instance Method Summary collapse

Instance Method Details

#placeholderObject



5
6
7
8
# File 'lib/simple_form_with_client_validation/components/placeholders.rb', line 5

def placeholder
  input_html_options[:placeholder] ||= placeholder_text
  nil
end

#placeholder_textObject



10
11
12
13
# File 'lib/simple_form_with_client_validation/components/placeholders.rb', line 10

def placeholder_text
  placeholder = options[:placeholder]
  placeholder.is_a?(String) ? placeholder : translate(:placeholders)
end