This project is archived and is in readonly mode.
Router feature request
Reported by ravinggenius | April 9th, 2010 @ 05:39 AM
It would be super fantastic if a route option like :path_base...
MyApp::Application.routes.draw do |map|
resources :nodes, :path_base => 'n'
end
...resulted in routes like...
GET /n(.:format) {:controller=>"nodes", :action=>"index"}
nodes POST /n(.:format) {:controller=>"nodes", :action=>"create"}
new_node GET /n/new(.:format) {:controller=>"nodes", :action=>"new"}
GET /n/:id(.:format) {:controller=>"nodes", :action=>"show"}
PUT /n/:id(.:format) {:controller=>"nodes", :action=>"update"}
node DELETE /n/:id(.:format) {:controller=>"nodes", :action=>"destroy"}
edit_node GET /n/:id/edit(.:format) {:controller=>"nodes", :action=>"edit"}
Is there currently a way to do this?
Comments and changes to this ticket
-
Cesario April 9th, 2010 @ 08:28 AM
Could you give a shot with ":as" ?
MyApp::Application.routes.draw do |map| resources :nodes, :as => 'n' end
-
ravinggenius April 9th, 2010 @ 03:04 PM
I tried that; :as changes the helper methods, but not the URLs. Combining options works:
resources :n, :controller => :nodes, :as => :nodes
-
Ryan Bigg April 10th, 2010 @ 08:26 AM
- Assigned user set to Mikel Lindsaar
-
Mikel Lindsaar April 10th, 2010 @ 08:29 AM
- State changed from new to resolved
OP has found a working solution.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>