Rename to optional to unless_blank

optional may be confusing with the optional method
This commit is contained in:
Rafael Mendonça França 2014-06-23 16:11:35 -03:00
parent ad9bf4b9aa
commit 0366830965
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ module SimpleForm
def wrap(input, options, content)
return content if options[namespace] == false
return if defaults[:optional] && content.empty?
return if defaults[:unless_blank] && content.empty?
tag = (namespace && options[:"#{namespace}_tag"]) || @defaults[:tag]
return content unless tag

View File

@ -78,7 +78,7 @@ module MiscHelpers
def custom_wrapper_with_optional_div_and_override
SimpleForm.build tag: :section, class: "custom_wrapper" do |b|
b.wrapper tag: :div, class: 'no_output_wrapper', optional: true do |ba|
b.wrapper tag: :div, class: 'no_output_wrapper', unless_blank: true do |ba|
ba.optional :hint, wrap_with: { tag: :p, class: 'omg_hint' }
end
end