Hi, I have problem in LiveView redirect to LiveView Controller
without refresh (server side). I used push_redirect
in normal LiveView like this code and it works but I want to redirect to other LiveView Controller and I don’t know how!!
redirect to other LiveView which I did:
def handle_event("go_to_categories", _value, socket) do
{
:noreply,
push_redirect(socket, to: Routes.live_path(socket, Categories))
}
end
now I want to redirect to categories
router instead of Live path
defmodule ErfanWeb.PageController do
use ErfanWeb, :controller
import Phoenix.LiveView.Controller
def index(conn, _params) do
live_render(conn, ErfanWeb.Live.Index , session: %{})
end
def categories(conn, _params) do
live_render(conn, ErfanWeb.Live.Categories , session: %{})
end
end
it is important don’t redirect with refresh
thanks