simply add wrapper_options argument to label_text to avoid warning

This commit is contained in:
Kai Chen 2014-06-20 10:21:06 +08:00
parent db8fbe94ae
commit 863adfc9e6
2 changed files with 2 additions and 4 deletions

View File

@ -31,7 +31,7 @@ module SimpleForm
end
end
def label_text
def label_text(wrapper_options = nil)
label_text = options[:label_text] || SimpleForm.label_text
label_text.call(html_escape(raw_label_text), required_label_text, options[:label].present?).strip.html_safe
end

View File

@ -12,9 +12,7 @@ module SimpleForm
method = input.method(@namespace)
if method.arity == 0
if method.name !~ /_text$/
ActiveSupport::Deprecation.warn(SimpleForm::CUSTOM_INPUT_DEPRECATION_WARN % { name: @namespace })
end
ActiveSupport::Deprecation.warn(SimpleForm::CUSTOM_INPUT_DEPRECATION_WARN % { name: @namespace })
method.call
else