I have a Rails app deployed to my server under the context scala_tour
. When going to the URL, everything works great. However, if the url is encoded to scala%5ftour
(which is what SO does, incidentally), I get an error from Rails and/or Passenger.
Passenger seems to recognize the URL and hands it off to my Rails app, but the Rails app complains with:
ActionController::RoutingError (No route matches "/scala%5Ftour" with {:method=>:get}):
Which is quite odd.
Other than putting in a redirect in Apache and deploying my app to a different context, how can I deal with this?
Versions
# yum list installed | grep http
httpd.i386 2.2.10-2.el5.eapps installed
# yum list installed | grep passen
passenger.i386 2.2.2-1eapps installed
# gem list | grep rails
rails (2.3.2, 2.2.2)
# ruby -v
ruby 1.8.6 (2008-06-20 patchlevel 230) [i386-linux]
routes.rb
ActionController::Routing::Routes.draw do |map|
map.resources :wiki_pages do |wiki_map|
wiki_map.history 'history', :controller => 'wiki_pages', :action => 'history', :method => 'GET'
wiki_map.version 'version/:sha1', :controller => 'wiki_pages', :action => 'version', :method => 'GET'
end
map.history '/history.:format', :controller => 'wiki_pages', :action => 'wiki_history', :method => 'get'
map.resources :diagrams, :only => [:index,:new,:destroy,:edit,:show]
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
map.login '/login', :controller => 'sessions', :action => 'new'
map.resources :users
map.resource :session
map.root :controller => 'wiki_pages', :action => 'show', :id => 'MainPage'
end
Apache conf
RailsBaseURI /scala_tour
PassengerPoolIdleTime 5