Hey people.
I’m trying to make my way through this article
https://littlelines.com/blog/2020/07/06/building-a-video-chat-app-in-phoenix-liveview
I’m not very experienced with Phoenix and LiveView I have to say. Just finding my way into the web topic. Anyway.. Since this article is already some days old I need to change a lot to make it work with today’s phoenix. But I got stuck pretty early. The form to make a new room was based on ~L and I have to move it into the whole ~H world. This is the render/1 function I came up with:
@impl true
def render(assigns) do
~H"""
<h1>Create a New Room</h1>
<.form :let={f} for={@changeset} phx-change="validate" phx-submit="add_match_result">
<.input field={{f, :title}} name="title" type="text" label="title" value={nil} />
<.input field={{f, :slug}} name="slug" type="text" label="slug" value={nil} />
<.button phx-disable-with="Saving...">Save</.button>
</.form>
"""
end
I thought it is pretty straight forward and I expected a callback to handle_event/3. But this is not happening. Instead I get an error inside my browser telling me
no route found for POST /room/new (LittlechatWeb.Router)
after I clicked the save button. As far as I understood liveView a POST request is the wrong thing to happen. But what is going wrong here?
This is the maybe important part of my router.ex if that helps:
scope "/room" do
live "/new", LittlechatWeb.Room.NewLive, :new
live "/:slug", LittlechatWeb.Room.ShowLive, :show
end






















