Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

name clash

  • Loading branch information...
commit f2db842812e412290e91ea572e66e5b4976cb9fd 1 parent 5240081
@jperrine authored
View
8 src/jimmyapi/controllers/images.clj
@@ -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)]
@@ -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)))
View
8 src/jimmyapi/views/images.clj
@@ -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"}
@@ -27,5 +27,5 @@
(layout/layout "Jimmy API"
(display-image image)))
-(defn new []
+(defn new-image []
(layout/layout "Jimmy API" (image-form)))
Please sign in to comment.
Something went wrong with that request. Please try again.