2010-11-07 09:41:33 +00:00
|
|
|
module SimpleForm
|
|
|
|
module Components
|
2011-12-04 14:49:57 +00:00
|
|
|
# Needs to be enabled in order to do automatic lookups.
|
2010-11-07 09:41:33 +00:00
|
|
|
module Placeholders
|
|
|
|
def placeholder
|
2011-12-04 13:57:12 +00:00
|
|
|
input_html_options[:placeholder] ||= placeholder_text
|
2011-12-04 11:29:53 +00:00
|
|
|
nil
|
2010-11-07 09:41:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def placeholder_text
|
2011-12-04 13:57:12 +00:00
|
|
|
if options[:placeholder] == true
|
2011-12-10 17:56:47 +00:00
|
|
|
translate(:placeholders)
|
2011-12-04 13:57:12 +00:00
|
|
|
else
|
|
|
|
options[:placeholder]
|
|
|
|
end
|
2010-11-07 09:41:33 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-12-10 17:56:47 +00:00
|
|
|
end
|