Permalink
Browse files

Add some comments, get rid of static posts vector.

  • Loading branch information...
1 parent 1f2b786 commit efc5b18e6a7155fef1da137c179d5c904c81fe10 @sbecker committed Jun 28, 2012
Showing with 3 additions and 9 deletions.
  1. +3 −1 src/osbridge_blog/models/post.clj
  2. +0 −8 src/osbridge_blog/views/posts.clj
@@ -4,13 +4,15 @@
(defentity posts)
-; Find by user id and uri
+; Find all posts
(defn all []
(select posts (order :id :desc)))
+; Find a single post by an ID
(defn find-by-id [id]
(first (select posts (where {:id (to-int id)}))))
+; Create a post
(defn create [{:keys [title content] :as post}]
(insert posts
(values {:title title
@@ -9,14 +9,6 @@
;;;;;;;;; Partials
-(def posts [{:id 1
- :title "First"
- :content "Hello"}
- {:id 2
- :title "Second"
- :content "Goodbye"}])
-
-
(defpartial post-item [{:keys [id title content]}]
[:div.post {:id id}
[:h3

0 comments on commit efc5b18

Please sign in to comment.