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:
parent
27ba278b6c
commit
cee443c2c6
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue