1
0
Fork 0
mirror of https://github.com/heartcombo/simple_form.git synced 2022-11-09 12:19:26 -05:00

Refactor a bit placeholder for mapping input (text only)

This commit is contained in:
Carlos Antonio da Silva 2010-10-27 15:28:21 -02:00
parent 27ba278b6c
commit cee443c2c6

View file

@ -14,7 +14,7 @@ module SimpleForm
def input_html_options
input_options = super
input_options[:placeholder] ||= placeholder if has_placeholder? and text?
input_options[:placeholder] ||= placeholder if has_placeholder?
input_options
end
@ -25,6 +25,10 @@ module SimpleForm
raise("Could not find method for #{input_type.inspect}")
end
def has_placeholder?
text? && super
end
def text?
input_type == :text
end