Skip to content
Browse files

Merge pull request #720 from achempion/patch-1

some problems with transfer options
  • Loading branch information...
2 parents e8bb7b3 + 9221f23 commit e462cb33c9f405114d8e4cb834e06921c535d09c @rafaelfranca rafaelfranca committed Jan 2, 2013
Showing with 11 additions and 1 deletion.
  1. +1 −1 lib/simple_form/action_view_extensions/builder.rb
  2. +10 −0 test/action_view_extensions/builder_test.rb
View
2 lib/simple_form/action_view_extensions/builder.rb
@@ -194,7 +194,7 @@ def collection_check_boxes(attribute, collection, value_method, text_method, opt
# end
def simple_fields_for(*args, &block)
options = args.extract_options!
- options[:wrapper] ||= self.options[:wrapper]
+ options[:wrapper] = self.options[:wrapper] if options[:wrapper].nil?
options[:defaults] ||= self.options[:defaults]
if self.class < ActionView::Helpers::FormBuilder
View
10 test/action_view_extensions/builder_test.rb
@@ -580,4 +580,14 @@ def with_collection_check_boxes(object, attribute, collection, value_method, tex
end
end
end
+
+ test 'fields don\'t inherites wrapper option from the parent form' do
+ swap_wrapper :another do
+ simple_form_for(:user, :wrapper => :another) do |f|
+ f.simple_fields_for(:company, :wrapper => false) do |company|
+ assert_not_equal :another, company.options[:wrapper]
+ end
+ end
+ end
+ end
end

0 comments on commit e462cb3

Please sign in to comment.
Something went wrong with that request. Please try again.