1
0
Fork 0
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:
Rafael Mendonça França 2012-06-26 23:23:40 -03:00
parent 9237674f73
commit ba65e1c3b0
2 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -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