Rails 2.3.5: How do I add an :id field to a namespace?
I want to have an admin area. So I wrote:
map.namespace "admin" do |admin|
admin.resources :cities
admin.resources :lin开发者_如何学Cks
end
But I would like to the admin area for a specific location. I am looking for something like:
map.namespace "admin/:location_id" do |admin|
admin.resources :cities
admin.resources :links
end
what would be the correct way to do this?
map.with_options(:path_prefix => "admin/:id", :name_prefix => "admin_") do |admin|
admin.resources :cities
admin.resources :links
end
You can remove :name_prefix
if you want
精彩评论