我是 Rails 新手,我正在尝试路由
0.0.0.0:3000/ratings/list
到控制器ratings
和方法list
但相反,我将index
方法list
作为参数
我的 routes.rb 就是这样
resources :ratings
match 'ratings/:won/update/:lost' => 'ratings#update'
match 'ratings/list' => 'ratings#list'
和耙路线是
ratings GET /ratings(.:format) ratings#index
POST /ratings(.:format) ratings#create
new_rating GET /ratings/new(.:format) ratings#new
edit_rating GET /ratings/:id/edit(.:format) ratings#edit
rating GET /ratings/:id(.:format) ratings#show
PUT /ratings/:id(.:format) ratings#update
DELETE /ratings/:id(.:format) ratings#destroy
/ratings/:won/update/:lost(.:format) ratings#update
ratings_list /ratings/list(.:format) ratings#list