Skip to content

Commit

Permalink
name clash
Browse files Browse the repository at this point in the history
  • Loading branch information
jperrine committed Mar 30, 2012
1 parent 5240081 commit f2db842
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/jimmyapi/controllers/images.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
(defn index []
(view/index (model/all)))

(defn new []
(view/new))
(defn new-image []
(view/new-image))

(defn create [params]
(let [image (:image params)]
Expand All @@ -24,8 +24,8 @@
(view/show (model/random)))

(defroutes routes
(GET "/" [] (random))
(GET "/" [] (random))
(GET "/images" [] (index))
(GET "/images/new" [] (new))
(GET "/images/new" [] (new-image))
(POST "/images" {params :params} (create params))
(GET "/images/:id" [id] (show id)))
8 changes: 4 additions & 4 deletions src/jimmyapi/views/images.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
(defn image-form []
[:div {:id "image-form" :class ""}
(form-to [:post "/images"]
(label "url" "Url")
(text-field "url")
(label "image[url]" "Url")
(text-field "image[url]")
(submit-button "Save"))])

(defn display-image [image]
[:a {:href "/random"} [:img {:src (image :url)}]])
[:a {:href "/"} [:img {:src (image :url)}]])

(defn display-images [images]
[:div {:id "images"}
Expand All @@ -27,5 +27,5 @@
(layout/layout "Jimmy API"
(display-image image)))

(defn new []
(defn new-image []
(layout/layout "Jimmy API" (image-form)))

0 comments on commit f2db842

Please sign in to comment.