Rename to optional to unless_blank
optional may be confusing with the optional method
This commit is contained in:
parent
ad9bf4b9aa
commit
0366830965
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue