Edited actionpack/lib/action_view/helpers/form_helper.rb via GitHub

This commit is contained in:
José Valim 2011-05-22 04:27:28 -07:00
parent 2cd2f51ded
commit 99b5020eb2
1 changed files with 1 additions and 0 deletions

View File

@ -1229,6 +1229,7 @@ module ActionView
RUBY_EVAL
end
# Check +fields_for+ for docs and examples.
def fields_for_with_index(record_name, record_object = nil, fields_options = {}, &block)
index = fields_options[:index] || options[:child_index] || nested_child_index(@object_name)
block_with_index = Proc.new{ |obj| block.call(obj, index) }