我有一个具有许多操作的控制器:
class TestsController < ApplicationController
def find
end
def break
end
def turn
end
end
当我像这样将它添加到我的routes.rb
文件中时:
resources :tests
并执行rake routes
我看到以下额外回合的任务:
tests GET /tests(.:format) tests#index
POST /tests(.:format) tests#create
new_test GET /tests/new(.:format) tests#new
edit_test GET /tests/:id/edit(.:format) tests#edit
test GET /tests/:id(.:format) tests#show
PUT /tests/:id(.:format) tests#update
DELETE /tests/:id(.:format) tests#destroy
显然我的控制器没有上述动作。那么我如何告诉 Rails 避免生成/期望这些路由呢?