Fork me on GitHub
#reitit
<
2020-12-16
>
Steven Deobald01:12:10

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).