swt2-intro-exercise / rails-exercise-18-lassesteffen

rails-exercise-18-lassesteffen created by GitHub Classroom
MIT License
0 stars 0 forks source link

Author index page should have a link to delete an author #14

Closed swt2public closed 5 years ago

swt2public commented 5 years ago

Scenario

Given an author named 'Alan Turing' When users visit the authors index page And a user clicks the delete link Then no error should occour

Hints

In order to delete a record according to the REST paradigm, a DELETE request needs to be made. Unfortunately, not many browsers support this. They mostly use GET and POST. However, the DELETE call can be made using JavaScript from the browser. Rails supports this out of the box by including a piece of JavaScript called rails-ujs. Using the data-method property of links, a different request can be made. This is also supported by Rails helpers: <%= link_to 'Delete', author_path(author), method: :delete %>

Error

Got AbstractController::ActionNotFound: The action 'destroy' could not be found for AuthorsController

Estimated progress: 56% complete

swt2public commented 5 years ago

Sorry, it's not working for me yet:

Scenario

Given an author named 'Alan Turing' When users visit the authors index page And a user clicks the delete link Then no error should occour

Error

Got AbstractController::ActionNotFound: The action 'destroy' could not be found for AuthorsController

If you have problems solving this task, please don't hesitate to contact the teaching team!