0
錯誤:沒有路線匹配{:action =>「show」,:controller =>「錦標賽「}沒有路線匹配{:action =>「show」,:controller =>「tournaments」}但是耙路線顯示錦標賽#show
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
的routes.rb:
resources :tournaments do
member do
get "results"
end
resources :opportunities do
member do
get 'rate'
end
end
end
執行搜索路線顯示:
...
tournament GET /tournaments/:id(.:format) tournaments#show
...
我在做什麼錯? (將隨着我在這個noob問題上的進展而更新)