This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-04
Channels
- # architecture (20)
- # aws (8)
- # beginners (13)
- # boot (9)
- # cider (80)
- # cljs-dev (69)
- # cljsrn (7)
- # clojure (243)
- # clojure-dusseldorf (8)
- # clojure-italy (5)
- # clojure-norway (3)
- # clojure-poland (57)
- # clojure-russia (10)
- # clojure-shanghai (2)
- # clojure-spec (11)
- # clojure-uk (50)
- # clojurescript (198)
- # core-async (11)
- # crypto (2)
- # cursive (14)
- # datomic (17)
- # figwheel (8)
- # garden (7)
- # hoplon (8)
- # incanter (4)
- # jobs (1)
- # leiningen (1)
- # liberator (38)
- # lumo (28)
- # om (55)
- # onyx (10)
- # pedestal (13)
- # perun (20)
- # re-frame (1)
- # reagent (16)
- # ring-swagger (9)
- # spacemacs (11)
- # test-check (9)
- # unrepl (43)
- # untangled (163)
- # yada (8)
@malcolmsparks The link at the end of this paragraph is dead: https://juxt.pro/yada/manual/index.html#hello-parameters
Is there a reason why I have to pass the route-params here, while they are already available in the context?
(yada/url-for c ::record {:route-params {:pmid “123”}})
PS: it would be a nice addition to the manual, wasn’t obvious to me how I should pass :pmid
, although the error said it was missingMaybe I’m speaking without thinking enough here, but is not the route-params in the ctx for the current request but the ones passed into url-for related to the url for what you ask for? Maybe you want the url for another pmid?
Yes. You're creating a link to another web resource. Leaking through the current path params might yield nasty surprises. (Principle of Least Surprise)
yeah, that makes sense. I had to search through Github examples how to pass the param, found it here: https://github.com/juxt/yada/blob/432d1b25f83a4af5d94d1108f37ee253a2a74bce/examples/phonebook/src/phonebook/resources.clj#L135
@malcolmsparks I could make a PR to add an example to the manual if you want?
Yes please. The manual could use some help