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

Delete request kept being sent as GET request. Issue only fixed by changing link_to to button_to.

Despite trying out extensive Stack Overflow and Google Fu answers, nothing worked except what is in the title. There were lots of suggestions to require jQuery which I did but to no avail.

I also noticed in the posts show.html.erb file that was created using rails generate scaffold, it also uses button_to and not link_to.

Now it look ugly since some are links and one is a button.

1 Answer

I ran into the save issue and below post helped. It appears to be a jQuery loading issue.

https://stackoverflow.com/questions/4423314/link-to-delete-url-is-not-working