heartcombo--simple_form/lib/simple_form/components/placeholders.rb

20 lines
417 B
Ruby
Raw Normal View History

module SimpleForm
module Components
# Needs to be enabled in order to do automatic lookups.
module Placeholders
def placeholder
input_html_options[:placeholder] ||= placeholder_text
nil
end
def placeholder_text
if options[:placeholder] == true
translate(:placeholders)
else
options[:placeholder]
end
end
end
end
end