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"
assoc-param (see
http://mmcgrana.github.com/ring/middleware.params-api.html) looks like
it could be what I need, but I can't find out how to use it in this
context (what wraps what and what is the right "map"?)
I realize that I could extract "path" from the request map, but I would
prefer a solution where what has been taken apart already is used,
instead of repeating that work.
--
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