visionmedia / express-resource

Resourceful routing for Express
1.41k stars 140 forks source link

add save and delete actions use http method `POST` #10

Closed fengmk2 closed 11 years ago

fengmk2 commented 13 years ago

support html form submit for data update. add save and delete actions use http method POST

deedubs commented 13 years ago

Seems like it would be better to handle this up the middleware stack with https://github.com/senchalabs/connect/blob/master/lib/middleware/methodOverride.js

pacovell commented 13 years ago

These can also be done using custom actions, already available. You don't need to modify index.js --

users.map('post', '/save', logoutAction); // (or 'save', if you want the local parameter included)

drewish commented 12 years ago

It does seem like kind of a shame to provide defaults that aren't compatible with forms... But I guess that's the only way that you can do it all on such a small set of URLs.