Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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!