rails/rails — Issue #5301: Nested shallows routes seem to lose the scoped :as
Author: pupeno
Created: 2012-03-06 13:21:25+00:00
State: open

If I have the following set of routes:

```ruby
scope :as => :foobar do
resources :albums do
resources :photos
end
end
```

I get the expected set of routes:

```
foobar_album_photos GET /albums/:album_id/photos(.:format) photos#index
POST /albums/:album_id/photos(.:format) photos#create
new_foobar_album_photo GET /albums/:album_id/photos/new(.:format) photos#new
edit_foobar_album_photo GET /albums/:album_id/photos/:id/edit(.:format) photos#edit
foobar_album_photo GET /albums/:album_id/photos/:id(.:format) photos#show
PUT /albums/:album_id/photos/:id(.:format) photos#update
DELETE /albums/:album_id/photos/:id(.:format) photos#destroy
foobar_albums GET /albums(.:format) albums#index
POST /albums(.:format) albums#create
new_foobar_album GET /albums/new(.:format) albums#new
edit_foobar_album GET /albums/:id/edit(.:format) albums#edit
foobar_album GET /albums/:id(.:format) albums#show
PUT /albums/:id(.:format) albums#update
DELETE /albums/:id(.:format) albums#destroy
```

but if I set it as a shallow route, like this:

```ruby
scope :as => :foobar do
resources :albums, :shallow => true do
resources :photos
end
end
```

in some methods, the :as specifier is lost:

```
album_photos GET /albums/:album_id/photos(.:format) photos#index
POST /albums/:album_id/photos(.:format) photos#create
new_album_photo GET /albums/:album_id/photos/new(.:format) photos#new
edit_photo GET /photos/:id/edit(.:format) photos#edit
photo GET /photos/:id(.:format) photos#show
PUT /photos/:id(.:format) photos#update
DELETE /photos/:id(.:format) photos#destroy
foobar_albums GET /albums(.:format) albums#index
POST /albums(.:format) albums#create
new_foobar_album GET /albums/new(.:format) albums#new
edit_album GET /albums/:id/edit(.:format) albums#edit
album GET /albums/:id(.:format) albums#show
PUT /albums/:id(.:format) albums#update
DELETE /albums/:id(.:format) albums#destroy
```