Skip to content
Browse files

update habtm_checkboxes to accept class for div wrapper

  • Loading branch information...
1 parent bcc0df9 commit 08cf5bfccb301ae8596cd7bb44640df50e70e92d Jonathan Garvin committed Sep 28, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/composable_builders/components/tagged.rb
View
6 lib/composable_builders/components/tagged.rb
@@ -76,8 +76,10 @@ def habtm_check_boxes(*args)
opts = args[2] || {}
field_name = opts.delete(:field_name) || format_field_name(method)
(String.new.tap { |s|
- s << @template.content_tag(:div, @template.content_tag(:label, field_name))
- s << @template.content_tag(:ul, build_habtm_check_boxes(method, choices, opts).html_safe, :class => 'multicheck')
+ s << @template.content_tag(:div, :class => (opts.delete(:class) || 'labeled_list')) do
+ @template.content_tag(:label, field_name) +
+ @template.content_tag(:ul, build_habtm_check_boxes(method, choices, opts).html_safe, :class => 'multicheck')
+ end
}).html_safe
end
end

0 comments on commit 08cf5bf

Please sign in to comment.
Something went wrong with that request. Please try again.