Browse files

This fixes my issue with collection check_boxes not showing their

error messages properly.

The solution here is to wrap the form_group with bootstrap_wrapping
which will set the label in the "right" place AND add the error
message in the right place.

Note that I'm having issues running tests in my environment - and am
looking to coordinate with project owner.
  • Loading branch information...
1 parent a7f4f56 commit 31404718505937c9b8edd21022262c4bfcc3a227 Jon Prettyman committed Mar 19, 2014
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/formtastic-bootstrap/inputs/check_boxes_input.rb
View
13 lib/formtastic-bootstrap/inputs/check_boxes_input.rb
@@ -7,12 +7,13 @@ class CheckBoxesInput < Formtastic::Inputs::CheckBoxesInput
# TODO Make sure help blocks work correctly.
def to_html
- form_group_wrapping do
- label_html <<
- hidden_field_for_all << # Might need to remove this guy.
- collection.map { |choice|
- choice_html(choice)
- }.join("\n").html_safe
+ bootstrap_wrapping do
+ form_group_wrapping do
+ hidden_field_for_all << # Might need to remove this guy.
+ collection.map { |choice|
+ choice_html(choice)
+ }.join("\n").html_safe
+ end
end
end

0 comments on commit 3140471

Please sign in to comment.