0
我加resource :products, :path => 'catalog/'
我routes.rb
,但我擊潰這個樣子:Rails的路線有沒有id
products POST /catalog(.:format) products#create
new_products GET /catalog/new(.:format) products#new
edit_products GET /catalog/edit(.:format) products#edit
GET /catalog(.:format) products#show
PATCH /catalog(.:format) products#update
PUT /catalog(.:format) products#update
DELETE /catalog(.:format) products#destroy
爲什麼他們沒有:id
S'例如,product#show
應具有URI /products/:id(.:format)
,對不對?
此外,= link_to products_path(product), class: 'product' do
使我http://localhost:3000/catalog.1
閱讀關於[* Singular Resources *](http://guides.rubyonrails.org/routing.html#singular-resources) – Pavan