1
<%= link_to 'Delete', [task.list, task],
                        method: :delete,
                        data: { confirm: 'Are you sure?' } %>

Started GET "/lists/2/tasks/4" for 127.0.0.1 at 2022-05-24 13:32:16 +0500

AbstractController::ActionNotFound (The action 'show' could not be found for TasksController)

2 Answers 2

0

Like @TTD said, you need to do something like this: <%= link_to "Delete", task_path(@path), method: :delete, data: { confirm: "Really?" } %> 0 as you need to reference just one object

Sign up to request clarification or add additional context in comments.

1 Comment

This doesn't actually work. Turbo uses data-turbo-method not data-method.
0

You need to replace [task.list, task], with the path like so: task_path(task) (or whatever your resource path is)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.