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 trialAnoop Mundathan
Full Stack JavaScript Techdegree Graduate 15,674 PointsWhy Query String ?method='PUT' is used instead of method='PUT'?
I can see in edit.jade
file below line
`form(action="/articles/" + article.id + "?_method=PUT", method="post")
Why method=post
is used rather than method="put"
?. Why query string is used in this case? .
1 Answer
Balázs Földesi
Full Stack JavaScript Techdegree Graduate 16,750 PointsThe only valid values here for the method attribute are 'get' or 'post'. On the query string it's specified that it's a put request. With the method-override (https://www.npmjs.com/package/method-override) npm package you can handle that request this way.
John Perry
Full Stack JavaScript Techdegree Graduate 41,012 PointsJohn Perry
Full Stack JavaScript Techdegree Graduate 41,012 PointsIs this explained somewhere in one of the videos?
Ryan Emslie
Full Stack JavaScript Techdegree Student 14,453 PointsRyan Emslie
Full Stack JavaScript Techdegree Student 14,453 PointsThis had me stumped for awhile. Thank you for posting the information.