On 03/23/2011 02:32 PM, Thorsten Wilms wrote:
Hi!

Routing, using ring.middleware.params and net.cgrand.moustache:
----
(def tlog-app-handler
(app ["admin" &]
{:get (app ...snip...)
:post (app wrap-params [[path not-empty] &] submit-article)}
----

Thanks to wrap-params, I can destructure request params within
submit-article. However, I also want to have "path". Without
wrap-params, it would simply be:
----
(app [[path not-empty] &] (submit-article path))
----

----
(app wrap-params [[path not-empty] &] (partial submit-article path))
----
results in "nth not supported on this type: PersistentHashMap"

Should have been:
----
(app [[path not-empty] &] (wrap-params (partial submit-article path)))
----
Which works, then.

Thanks to the fine folks in #clojure, I have another solution:
----
(app [[path not-empty] &] (wrap-params
                           (fn [req] (submit-article req path))))
----


--
Thorsten Wilms

thorwil's design for free software:
http://thorwil.wordpress.com/

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to