Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Edited lib/nested_form/builder.rb via GitHub

  • Loading branch information...
commit 8759928f1a1d3f70c4542f1fd549255860ea2863 1 parent 89953fa
Blake Jakopovic authored

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  lib/nested_form/builder.rb
8  lib/nested_form/builder.rb
@@ -48,12 +48,16 @@ def link_to_remove(*args, &block)
48 48
       hidden_field(:_destroy) + @template.link_to(*args, &block)
49 49
     end
50 50
 
51  
-    def fields_for_with_nested_attributes(association_name, args, block)
  51
+    def fields_for_with_nested_attributes(association_name, *args, block)
52 52
       # TODO Test this better
53 53
       block ||= Proc.new { |fields| @template.render(:partial => "#{association_name.to_s.singularize}_fields", :locals => {:f => fields}) }
54 54
       @fields ||= {}
55 55
       @fields[association_name] = block
56  
-      super(association_name, args, block)
  56
+      if Rails::VERSION::MAJOR >= 3 && Rails::VERSION::MINOR >= 1
  57
+        super(association_name, args.first, args.last, block)
  58
+      else
  59
+        super(association_name, *args, block)
  60
+      end
57 61
     end
58 62
 
59 63
     def fields_for_nested_model(name, object, options, block)

0 notes on commit 8759928

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