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
|
2012-01-11 20:12:49 +00:00
|
|
|
placeholder = options[:placeholder]
|
|
|
|
placeholder.is_a?(String) ? placeholder : translate(:placeholders)
|
2010-11-07 09:41:33 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-12-10 17:56:47 +00:00
|
|
|
end
|