Permalink
Browse files

add in the hidden text field for boolean fields

  • Loading branch information...
1 parent 0804377 commit c4025b250297fa11de6f205eca76f51380845de9 @danklassen danklassen 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 c4025b2

Please sign in to comment.