Skip to content

Instantly share code, notes, and snippets.

@burke
Created February 22, 2009 07:29
Show Gist options
  • Save burke/68387 to your computer and use it in GitHub Desktop.
Save burke/68387 to your computer and use it in GitHub Desktop.
#rails/actionpack/lib/action_view/helpers/form_helper.rb:508
if @object_name.sub!(/\[\]$/,'')
if object ||= @template_object.instance_variable_get("@#{Regexp.last_match.pre_match}") and object.respond_to?(:to_param)
@auto_index = object.to_param
else
raise ArgumentError, "object[] naming but object param and @object var don't exist or don't respond to to_param: #{object.inspect}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment