Permalink
Browse files

Using id as part of URI to be more restfull

  • Loading branch information...
Emerson Macedo authored and pedrofranceschi committed Dec 11, 2010
1 parent 2727545 commit 211db761422e0320a20fbc5e31cea00a169ba3f6
Showing with 2 additions and 2 deletions.
  1. +1 −1 blogode.js
  2. +1 −1 views/admin/posts/edit.ejs
View
@@ -136,7 +136,7 @@ app.post('/admin/posts/save', function(req, res) {
});
});
-app.put('/admin/posts/update', function(req, res) {
+app.put('/admin/posts/:id', function(req, res) {
// updates a post
if(!req.session.username) {
@@ -28,7 +28,7 @@
});
</script>
-<form method="post" action="/admin/posts/update" id="createRoomForm">
+<form method="post" action="/admin/posts/<%= post.id %>" id="createRoomForm">
<input type="hidden" name="_method" value="put" />
<h1>New Post</h1>
Title: <input type="text" name="title" size="62" value="<%= unescape(post.title) %>"/><br/><br/>

0 comments on commit 211db76

Please sign in to comment.