Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Rails Routes and Resources A Route to a Delete Action Deleting Pages

Andrea Gomez
Andrea Gomez
8,609 Points

Delete method not working on Rails 5.1.4

I wrote the syntax verbatim to the one in the video but it's not working.

What changes do I need to make in order for the delete method to work on Rails 5.1.4?

The console is processing it as a GET request but I've defined it on my routes to be treated as a DELETE request.

Jay McGavren
Jay McGavren
Treehouse Teacher

Ideally, we recommend running the code samples on the same version of rails that we show in the course. That is, some version of rails 5.0.

But I don't know of any reason that the code shouldn't work as is on Rails 5.1. Can you please post the text that you are seeing in your rails log? Can you also post the contents of your routes.rb file?

2 Answers

Juan Gonzalez
Juan Gonzalez
12,960 Points

Hi Andrea, did you could fix this issue? I'm doing the course in Rails 5.1.4 and I can make everything as shown in the videos without any problem.

If you still have problems it would be helpful if you post a little bit of your code so we can check it out and give you a better answers

Andrea Gomez
Andrea Gomez
8,609 Points

Hello Juan & Jay, I accidentally blocked the js files. The problem is solved now, thanks so much!