Permalink
Browse files

backport 7c4c4f3 into 1.2-stable

  • Loading branch information...
1 parent 4598a5f commit 17cc8c2025a65a643390ed584cec50b53ba246cd @justinfrench committed Apr 4, 2011
Showing with 3 additions and 2 deletions.
  1. +1 −1 lib/formtastic.rb
  2. +2 −1 spec/inputs/boolean_input_spec.rb
View
@@ -1272,7 +1272,7 @@ def boolean_input(method, options)
# the label() method will insert this nested input into the label at the last minute
options[:label_prefix_for_nested_input] = input
- template.hidden_field_tag((html_options[:name] || "#{@object_name}[#{method}]"), unchecked_value, :id => nil) << label(method, options)
+ template.hidden_field_tag((html_options[:name] || "#{@object_name}[#{method}]"), unchecked_value, :id => nil, :disabled => html_options[:disabled]) << label(method, options)
end
# Generates an input for the given method using the type supplied with :as.
@@ -69,7 +69,8 @@
end
output_buffer.concat(form) if Formtastic::Util.rails3?
- output_buffer.should have_tag('form li label input[@disabled="disabled"]')
+ output_buffer.should have_tag('form li label input[@disabled="disabled"]', :count => 1)
+ output_buffer.should have_tag('form li input[@type="hidden"][@disabled="disabled"]', :count => 1)
end
it 'should generate an input[id] with matching label[for] when id passed in :input_html' do

0 comments on commit 17cc8c2

Please sign in to comment.