Fix routing for Rails 4

Some other compatibility issues remain.