이상한 문제가 있습니다. 내보기에이 같은 코드가 있습니다URL 대신에 id 형식의 레일 형식
= link_to 'Destroy', quests_path(quest), method: :destroy, class: 'btn btn-danger'
을하지만 내 URL이 경우 다음과 같습니다
http://localhost:8080/quests.1
과 PARAMS에 내가
action: index
controller: web/quests
format: '1'
을하지만 ID가 필요 대신 형식으로 params. 도와주세요.
편집 됨 : 메서드 : : 삭제가 올바르게 작동하지 않습니다.
routes.rb 파일 :
scope module: :web do
root to: 'quests#index'
match '/logout', to: 'sessions#destroy'
resources :quests, only: [:new, :create, :index, :destroy] do
get 'change_state', on: :member
end
resource :session, only: [:new, :create, :destroy]
resource :user, only: [:new, :create, :destroy] do
scope module: :user do
end
end
end
도움이 소원하지만 지금 내가 가지고있는 오류 '어떤 경로 일치 "/ 퀘스트/1"[얻을]를'. 나는 방법을 보여주지 않았고 나는 이것을 필요로하지 않는다. 그것은 'method : : destroy'가 작동하지 않는다는 것을 의미합니까? 그것을 고치는 방법? – cnaize
@NikitaKissMe 언제이 오류가 발생합니까? –
내가 누를 때 – cnaize