Phoenix.LiveView.Helpers.live_redirect
You're seeing just the function
live_redirect
, go back to Phoenix.LiveView.Helpers module for more information.
Generates a link that will redirect to a new LiveView.
The current LiveView will be shut down and a new one will be mounted
in its place, without reloading the whole page. This can
also be used to remount the same LiveView, in case you want to start
fresh. If you want to navigate to the same LiveView without remounting
it, use live_patch/2
instead.
Options
:to
- the required path to link to.:replace
- the flag to replace the current history or push a new state. Defaultsfalse
.
All other options are forwarded to the anchor tag.
Examples
<%= live_redirect "home", to: Routes.page_path(@socket, :index) %>
<%= live_redirect "next", to: Routes.live_path(@socket, MyLive, @page + 1) %>
<%= live_redirect to: Routes.live_path(@socket, MyLive, dir: :asc), replace: false do %>
Sort By Price
<% end %>