reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
Steven Deobald 2020-12-16T01:14:10.420500Z

Another, perhaps slightly silly, question. Is there any obvious way I’m not thinking of to alias route names? For example:

["/image/:id" {:name   ::image-show
               :get    image-handler/show
               :delete image-handler/destroy}]
In this case, is there a way to create an alias name (say, ::image-destroy) so that the “action” (in Rails parlance) is maintained? For instance:
(f/form-to [:delete (v/path-for req :kosa.routes/image-show (:crux.db/id image))]
           (f/submit-button {:name "submit"} "Delete Image"))
…feels a bit silly, even though it’s correct with the routes as I have them set up. (`v/path-for` just delegates to match->path).