0
ActionController::UrlGenerationError: No route matches
{:action=>"/microposts/583546149", :controller=>"microposts"}
: 부분을 내가 본 한 조각에
test "should redirect destroy for wrong micropost" do
log_in_as(users(:michael))
micropost = microposts(:ants)
assert_no_difference 'Micropost.count' do
delete micropost_path(micropost)
end
assert_redirected_to root_url
end
다음 줄
delete micropost_path(micropost)
는 나에게 다음과 같은 오류를주고 있었다 전형적인 삭제 HTTP 요청의 온라인 뭔가가 본질적으로 잘못되었다는 내게 단서. 나는 호기심 튜토리얼에서 마이클 하틀 일반적으로 자원을 삭제하는 다음 구문을 사용했다고도 언급했다 :
delete :destroy, id: micropost
그냥 명확하게하기 위해, 후자는 예상대로 작동하는 것 같다. 내 질문은 두 가지입니다.
둘 다 유효합니까? 차이점이 뭐야?