fix routing issue

The Rails.application.routes object is global to the Rails application. You are modifying this object's singleton class. We shouldn't modify globals like this. This code and the similar code in Rails32 is revealing a role within the system; the role of a ```Router```. We should represent this role formally and reuse code where we can.