diff --git a/lib/simple_form/wrappers/many.rb b/lib/simple_form/wrappers/many.rb index dc90a384..dc5eddfe 100644 --- a/lib/simple_form/wrappers/many.rb +++ b/lib/simple_form/wrappers/many.rb @@ -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 diff --git a/lib/simple_form/wrappers/single.rb b/lib/simple_form/wrappers/single.rb index b972afea..da39bd6f 100644 --- a/lib/simple_form/wrappers/single.rb +++ b/lib/simple_form/wrappers/single.rb @@ -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