Reputation: 5962
I guess this thing has amused me even before writing I feel it has something to do with asset pipeline feature in Rails 3.1+.
I have defined a routes in routes.rb file with name assets. Here is the routes.rb file:
resources :assets do
member do
get 'remove_template'
get 'all_sticker'
get 'download_sticker'
end
collection do
get 'failed_asset'
end
end
Now when ran rake routes
:
sample_template_sticker_template GET /sticker_templates/:id/sample_template(.:format) sticker_templates#sample_template
update_copy_sticker_template PUT /sticker_templates/:id/update_copy(.:format) sticker_templates#update_copy
sticker_templates GET /sticker_templates(.:format) sticker_templates#index
POST /sticker_templates(.:format) sticker_templates#create
new_sticker_template GET /sticker_templates/new(.:format) sticker_templates#new
edit_sticker_template GET /sticker_templates/:id/edit(.:format) sticker_templates#edit
sticker_template GET /sticker_templates/:id(.:format) sticker_templates#show
PUT /sticker_templates/:id(.:format) sticker_templates#update
DELETE /sticker_templates/:id(.:format) sticker_templates#destroy
thank_you /thank_you(.:format) home#thank_you
home /welcome(.:format) home#index
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PUT /users/password(.:format) devise/passwords#update
login GET / devise/sessions#new
logout GET /logout(.:format) devise/sessions#destroy
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
products GET /products(.:format) products#index
POST /products(.:format) products#create
new_product GET /products/new(.:format) products#new
edit_product GET /products/:id/edit(.:format) products#edit
product GET /products/:id(.:format) products#show
PUT /products/:id(.:format) products#update
DELETE /products/:id(.:format) products#destroy
create_sticker_stickers GET /stickers/create_sticker(.:format) stickers#create_sticker
stickers GET /stickers(.:format) stickers#index
POST /stickers(.:format) stickers#create
new_sticker GET /stickers/new(.:format) stickers#new
edit_sticker GET /stickers/:id/edit(.:format) stickers#edit
sticker GET /stickers/:id(.:format) stickers#show
PUT /stickers/:id(.:format) stickers#update
DELETE /stickers/:id(.:format) stickers#destroy
As you can see I can't find any routes define for assets resources even though I can access all of the available routes I define for assets in routes.rb
.
Can anyone explain why the output of rake routes
does not contain information for assets resources.
Upvotes: 1
Views: 231
Reputation: 15771
Change the path of your resource (assets
) and you'll be fine! It'll resolve conflicts with the default /assets
path that is used for serving your styles/images/javasctipts.
Try this:
resources :assets, path: '/my_assets' do
Upvotes: 1