mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
Fix namespace html propagation to single wrapper of label and input
This commit is contained in:
parent
9237674f73
commit
ba65e1c3b0
2 changed files with 13 additions and 1 deletions
|
@ -56,11 +56,15 @@ module SimpleForm
|
|||
return content unless tag
|
||||
|
||||
klass = html_classes(input, options)
|
||||
opts = options[:"#{namespace}_html"] || {}
|
||||
opts = html_options(options)
|
||||
opts[:class] = (klass << opts[:class]).join(' ').strip unless klass.empty?
|
||||
input.template.content_tag(tag, content, opts)
|
||||
end
|
||||
|
||||
def html_options(options)
|
||||
options[:"#{namespace}_html"] || {}
|
||||
end
|
||||
|
||||
def html_classes(input, options)
|
||||
@defaults[:class].dup
|
||||
end
|
||||
|
|
|
@ -13,6 +13,14 @@ module SimpleForm
|
|||
wrap(input, options, content) if content
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def html_options(options)
|
||||
return {} if [:label, :input].include?(namespace)
|
||||
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue