Patch to fix issue with routing and default formats

There's a bug in the code that handles positional arguments in Rails routing that causes a default format to be lost when there is more than just the format parameter present in the route.

Pull request to fix here: https://github.com/rails/rails/pull/18627

Cheers,

Tekin