1
지금까지 내 routes.rb 파일은 다음과 같이 보입니다 수행자원의 내부 경로를 레일 : ㅋ ㅋ
resources :games do
resources :planets do
member do
get 'index' as: :play_game
end
end
end
이를 생성
play_game_game_planet GET /games/:game_id/planets/:id/index(.:format) planets#index
game_planets GET /games/:game_id/planets(.:format) planets#index
POST /games/:game_id/planets(.:format) planets#create
new_game_planet GET /games/:game_id/planets/new(.:format) planets#new
edit_game_planet GET /games/:game_id/planets/:id/edit(.:format) planets#edit
game_planet GET /games/:game_id/planets/:id(.:format) planets#show
PATCH /games/:game_id/planets/:id(.:format) planets#update
PUT /games/:game_id/planets/:id(.:format) planets#update
DELETE /games/:game_id/planets/:id(.:format) planets#destroy
하지만 경로 I (나는 레이크 경로를 검사 할 때) 원하는 당신은 이미 game_planets /games/:game_id/planets(.:format) planets#index
경로가 위의 정의
play_game GET /games/:game_id/planets(.:format) planets#index
정확히 내가 리소스 블록 내부에서 이름을 지정하면 상황이 추가되지만 외부에서 제대로 작동하면됩니다. –