requests/index.html.erb にアクセスするときの問題は次のとおりです。
ルーティング エラー
{:action="cancel", :controller="requests"} に一致するルートはありません
index.html.erb:
<%= link_to "Cancel", cancel_request_path %>
ルート.rb:
resources :requests do
get 'cancel', on: :member
end
requests_controller.rb:
def cancel
request = Request.find(params[:id])
request.update_attributes(stage: "Cancelled")
redirect_to root_path
end
私は何が欠けていますか?