I have a Rails 3 engine gem that is for basic user authentication and authorization. Within that Gem the config/routes.rb
defines the following
resources :users
match '/:controller(/:action(/:id))'
When I do a rake routes
from the application that requires this gem I get the following routes
rake routes|grep users
users GET /users(.:format) {:controller=>"users", :action=>"index"}
users POST /users(.:format) {:controller=>"users", :action=>"create"}
new_user GET /users/new(.:format) {:controller=>"users", :action=>"new"}
edit_user GET /users/:id/edit(.:format) {:controller=>"users", :action=>"edit"}
user GET /users/:id(.:format) {:controller=>"users", :action=>"show"}
user PUT /users/:id(.:format) {:controller=>"users", :action=>"update"}
user DELETE /users/:id(.:format) {:controller=>"users", :action=>"destroy"}
This is what I expect.
However when I try to access the following routes via a browser
/users/137
/users/137/edit
I get the following error in the logs
AbstractController::ActionNotFound (The action '137' could not be found for UsersController):
actionpack (3.0.0) lib/abstract_controller/base.rb:114:in `process'
actionpack (3.0.0) lib/abstract_controller/rendering.rb:40:in `process'
...
What is interesting is that the following paths do work
/users/show/137
/users/edit/137
Also if I add the following to the routes.rb file in the application that is requiring the gem it all works as expected.
resources :users
Is there something I am missing or is this a bug?
Note that I am also doing the following when I start my application on the command line when I start the rails I set the following env variable
RAILS_RELATIVE_URL_ROOT="/my_app"
and in config.ru
map '/my_app' do
run MSEL::Application
end