How to Write an Event Handler in Phoenix: Revision history

Jump to: navigation, search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

10 June 2024

  • curprev 15:1215:12, 10 June 2024Admin talk contribs 361 bytes +361 Created page with "==Example== <source> defmodule AppWeb.PageLive do use AppWeb, :live_view def mount(_params, _session, socket) do {:ok, socket} end def handle_event("run", unsigned_params, socket) do IO.inspect "It works!" {:noreply, socket} end def render(assigns) do ~H""" <p phx-click="run">TEST</p> """ end end </source>"