Permalink
Browse files

Merge pull request #800 from mhuggins/indexed-labels

Fix build error from #798
  • Loading branch information...
2 parents 82b552d + 46e7658 commit eecfebbc775eefd69376cd52be82949e2c5ab715 @justinfrench committed Feb 15, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/formtastic/helpers/inputs_helper.rb
@@ -371,8 +371,12 @@ def inputs_for_nested_attributes(*args, &block) #:nodoc:
'but the block does not accept any argument.' if block.arity <= 0
lambda do |f|
contents = f.inputs(*args) do
- index = parent_child_index(options[:parent]) if options[:parent]
- block.call(f, index)
+ if block.arity == 1 # for backwards compatibility with REE & Ruby 1.8.x
+ block.call(f)
+ else
+ index = parent_child_index(options[:parent]) if options[:parent]
+ block.call(f, index)
+ end
end
template.concat(contents)
end

0 comments on commit eecfebb

Please sign in to comment.