Skip to content

Commit

Permalink
fixed route and add travis ci config
Browse files Browse the repository at this point in the history
  • Loading branch information
helly(양완수) committed Jul 7, 2015
1 parent 1017759 commit dab3dc4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: clojure
script: lein test

2 changes: 1 addition & 1 deletion resources/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</form>
<input type="submit" form="delete-form-{{item.id}}" class="btn btn-primary" value="delete" />

<a href="/update?id={{item.id}}" class="btn btn-primary"> update </a>
<a href="/update/{{item.id}}" class="btn btn-primary"> update </a>
</li>
{% endfor %}
</ul>
Expand Down
6 changes: 3 additions & 3 deletions src/guestbook/routes/home.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
(db/delete-message! {:id id})
(redirect "/")))

(defn update-message [id]
(if (empty? params)
(defn update-message [id {:keys [flash]}]
(if (nil? id)
(redirect "/")
(layout/render
"update.html"
Expand All @@ -53,6 +53,6 @@
(GET "/" request (home-page request))
(POST "/" request (save-message! request))
(POST "/delete/:id" [id] (delete-message! id))
(GET "/update/:id" [id] (update-message id))
(GET "/update/:id" [id req] (update-message id req))
(POST "/update" request (update-message! request))
(GET "/about" [] (about-page)))

0 comments on commit dab3dc4

Please sign in to comment.