E.g:
live "/c/:category_id", IndexLive
live "/t/:tag_id", IndexLive
Use the live_link
to navigate:
<%= live_link “Hello”,
to: Routes.live_path(@socket, BlogWeb.IndexLive, 10001) %>
As above, only paths with a link of /c/10001
can be generated. How do I choose to generate the /t/10001
path?
preciz
2
Have you tried with the :as
option?
live "/c/:category_id", IndexLive, as: "c_route"
live "/t/:tag_id", IndexLive, as: "t_route"
5 Likes