Experienced guys, tell me how to solve the problem: there is a link to delete the answer attached to the question:

link_to 'delete', questions_answers_path(@question, answer), method: :delete 

When clicking the error of routing falls out:

 No route matches [DELETE] "/questions/1434/answers.121" 

Resources invested:

 resources :questions do resources :answers , shallow: true end 

What could be the problem?

1 answer 1

Contact answer_path directly by passing the response id:

 link_to 'delete', answer_path(answer), method: :delete 

Where answer is the response id