Steps to reproduce
Total newcomer to Ruby and Rails, enjoying the tutorial 😄. I've followed the Edge Getting Started guide step by step, but when I get to step 6.5 I've hit this issue.
I've pushed my repo here
Expected behavior
When clicking the 'Destroy' link on the article page, the article should be removed from the database.
Actual behavior
The article is requested from the server and displayed again
When I click the destroy link I notice in the logs that the server receives a GET request for the article:
Started GET "/articles/1" for ::1 at 2021-10-11 14:09:56 +0100
I think what's happening is that some UJS should be looking for this link based on the data-method="delete" attribute, and changing the GET to a DELETE (or maybe a POST that does a DELETE). I'm guessing that the JS isn't running, so a simple GET is issued.
I've spotted some historic discussion that the assets are not being compiled so the jquery is missing, but that looks out of date. I've also tried running the server in development mode using bin/rails server -e development, but see the same problem.
System configuration
Running on MacOS (11.6) on MacBook Pro M1, tested in Safari & Chrome
Rails version: 7.0.0.alpha2
Ruby version: 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]
Steps to reproduce
Total newcomer to Ruby and Rails, enjoying the tutorial 😄. I've followed the Edge Getting Started guide step by step, but when I get to step 6.5 I've hit this issue.
I've pushed my repo here
Expected behavior
When clicking the 'Destroy' link on the article page, the article should be removed from the database.
Actual behavior
The article is requested from the server and displayed again
When I click the destroy link I notice in the logs that the server receives a GET request for the article:
Started GET "/articles/1" for ::1 at 2021-10-11 14:09:56 +0100I think what's happening is that some UJS should be looking for this link based on the
data-method="delete"attribute, and changing the GET to a DELETE (or maybe a POST that does a DELETE). I'm guessing that the JS isn't running, so a simple GET is issued.I've spotted some historic discussion that the assets are not being compiled so the jquery is missing, but that looks out of date. I've also tried running the server in development mode using
bin/rails server -e development, but see the same problem.System configuration
Running on MacOS (11.6) on MacBook Pro M1, tested in Safari & Chrome
Rails version: 7.0.0.alpha2
Ruby version: 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]