Permalink
Browse files

Merge pull request #91 from danklassen/fix-checkbox-hidden-field

add in the hidden text field for boolean fields
  • Loading branch information...
2 parents 0804377 + c4025b2 commit 5a264146c03a93800f157d136d2a62cdf2e2196f @sodabrew sodabrew committed Jan 16, 2014
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/formtastic-bootstrap/inputs/boolean_input.rb
@@ -6,11 +6,16 @@ class BooleanInput < Formtastic::Inputs::BooleanInput
def to_html
checkbox_wrapping do
+ hidden_field_html <<
"".html_safe <<
[label_with_nested_checkbox, hint_html].join("\n").html_safe
end
end
+ def hidden_field_html
+ template.hidden_field_tag(input_html_options[:name], unchecked_value, :id => nil, :disabled => input_html_options[:disabled] )
+ end
+
def label_with_nested_checkbox
builder.label(
method,

0 comments on commit 5a26414

Please sign in to comment.