我有這個在我的路線:的Rails:路由問題
resources :cvits
產生這些路線:
cvits GET /cvits(.:format) {:controller=>"cvits", :action=>"index"}
POST /cvits(.:format) {:controller=>"cvits", :action=>"create"}
new_cvit GET /cvits/new(.:format) {:controller=>"cvits", :action=>"new"}
edit_cvit GET /cvits/:id/edit(.:format) {:controller=>"cvits", :action=>"edit"}
cvit GET /cvits/:id(.:format) {:controller=>"cvits", :action=>"show"}
PUT /cvits/:id(.:format) {:controller=>"cvits", :action=>"update"}
DELETE /cvits/:id(.:format) {:controller=>"cvits", :action=>"destroy"}
,但我想我的網址是單數(例如/ cvit /,/ cvit/new,/ cvit /:id)。什麼是最簡單的方法來改變這個?
謝謝!
解決:想通了,我所做的:
資源:cvits,:PATH => 'cvit'
只是一個通知:它不會花費任何東西來接受一個答案。 – apneadiving