Module: SimpleForm::Components::Placeholders
- Included in:
- Inputs::Base
- Defined in:
- lib/simple_form/components/placeholders.rb
Instance Method Summary collapse
- #has_placeholder? ⇒ Boolean
- #placeholder ⇒ Object
- #placeholder_present? ⇒ Boolean
- #placeholder_text ⇒ Object
Instance Method Details
#has_placeholder? ⇒ Boolean
9 10 11 |
# File 'lib/simple_form/components/placeholders.rb', line 9 def has_placeholder? false end |
#placeholder ⇒ Object
4 5 6 7 |
# File 'lib/simple_form/components/placeholders.rb', line 4 def placeholder [:placeholder] ||= placeholder_text if has_placeholder? nil end |
#placeholder_present? ⇒ Boolean
13 14 15 |
# File 'lib/simple_form/components/placeholders.rb', line 13 def placeholder_present? [:placeholder] != false && placeholder_text.present? end |
#placeholder_text ⇒ Object
17 18 19 |
# File 'lib/simple_form/components/placeholders.rb', line 17 def placeholder_text @placeholder ||= [:placeholder] || translate(:placeholders) end |