错误:没有路线匹配 {:action=>"show", :controller=>"tournaments"}
class TournamentsController < ApplicationController
def new
@tournament = Tournament.new
end
def create
@tournament = Tournament.new(params[:tournament].permit(:description))
if @tournament.save
#flash[:notice] = 'tournament was successfully created.'
#set up links
redirect_to :action => 'show'
else
render :action => 'new'
end
end
def show
@tournament = Tournament.first
end
end
路线.rb:
resources :tournaments do
member do
get "results"
end
resources :opportunities do
member do
get 'rate'
end
end
end
执行 rake 路由显示:
...
tournament GET /tournaments/:id(.:format) tournaments#show
...
我究竟做错了什么?(将随着我通过这个菜鸟问题的进展而更新)