Permalink
Browse files

never render fantom hidden input

  • Loading branch information...
dnagir committed Oct 1, 2011
1 parent e4d9a76 commit 7f71bd9840c1a406a9dc3c047d98258912a9a9a5
Showing with 7 additions and 1 deletion.
  1. +3 −1 lib/formtastic/inputs/check_boxes_input.rb
  2. +4 −0 spec/inputs/check_boxes_input_spec.rb
@@ -109,7 +109,9 @@ def choice_html(choice)
end
def hidden_field_for_all
- if hidden_fields?
+ show_fantom = options[:hidden_fields]
+ show_fantom = true if show_fantom.nil?
+ unless show_fantom
""
else
options = {}
@@ -185,6 +185,10 @@
it 'should not generate empty hidden inputs' do
output_buffer.should_not have_tag("form li fieldset ol li label input[@type='hidden'][@value='']", :count => ::Post.all.length)
end
+
+ it 'should not generate any hidden inputs' do
+ output_buffer.should_not have_tag("form li fieldset input[@type='hidden']")
+ end
end
describe 'when :disabled is set' do

0 comments on commit 7f71bd9

Please sign in to comment.