Routing question

Hello

Given the following rules

MyApp::Application.routes.draw do |map|

resources :accounts do
    resources :comments
end

match '*path' => redirect("/accounts/%{path}")

end

Can we get ActionDispatch to, rather than redirect, re-run the routes?
This would come in handy for using account handles, as in

http://mymusicwebsite.com/metallica
http://mymusicwebsite.com/metallica/comments
http://mymusicwebsite.com/metallica/comments/2

rather than

http://mymusicwebsite.com/accounts/metallica
http://mymusicwebsite.com/accounts/metallica/comments
http://mymusicwebsite.com/accounts/metallica/comments/2

Any help appreciated.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs