when passing an array as first argument to form_for, polymorphic_url
checks if first index is an instance of

def polymorphic_url(record_or_hash_or_array, options = {})
if record_or_hash_or_array.kind_of?(Array)
record_or_hash_or_array = record_or_hash_or_array.compact
if record_or_hash_or_array.first.is_a?
proxy = record_or_hash_or_array.shift
record_or_hash_or_array = record_or_hash_or_array[0] if
record_or_hash_or_array.size == 1

It later than calls a named route on routesproxy object if it is not

(proxy || self).send(named_route, *args)

What exactly is RoutesProxy?

The documentation does a terrible job at explaining it:

And at moment I’d prefer some feedback before digging into the source.

I would like to bump this. Simple question. When will the first
element of an array passed as first argument to form_for ever be an
instance of RoutesProxy? The rails source looks for this, so I am sure
someone out there has examples.