User contributions for Admin
10 May 2025
- 07:0007:00, 10 May 2025 diff hist +720 N LiveView Web API Request Example Created page with "<source> defmodule AppWeb.Sandbox do use AppWeb, :live_view def mount(_params, _session, socket) do {:ok, socket} end def handle_event("start_task", _params, socket) do Task.async(fn -> Req.get!("https://api.github.com/repos/wojtekmach/req") end) {:noreply, socket} end def handle_info({ref, result}, socket) do Process.demonitor(ref, [:flush]) IO.inspect"________________________________________________________________________________"..." current
- 05:1505:15, 10 May 2025 diff hist +793 N Phoenix Handle Info Self Example Created page with "<source> defmodule AppWeb.Sandbox do use AppWeb, :live_view require Logger def mount(_params, _session, socket) do {:ok, assign(socket, :count, 0)} end def handle_event("increment", _params, socket) do # Send a message to ourselves after 1000 milliseconds (1 second) Process.send_after(self(), :delayed_increment, 1000) {:noreply, socket} end def handle_info(:delayed_increment, socket) do new_count = socket.assigns.count + 1 Logger...." current
17 April 2025
- 20:1720:17, 17 April 2025 diff hist +24 Sort Collection Via Event Handler No edit summary current
- 19:5519:55, 17 April 2025 diff hist +1,388 N Sort Collection Via Event Handler Created page with "<source> defmodule AppWeb.SandboxLive do use AppWeb, :live_view alias App.TestBeds alias App.TestBeds.TestBed alias App.Repo import Ecto.Query def mount(_params, _session, socket) do testbeds = Repo.all(from(t in TestBed, order_by: t.name)) {:ok, assign(socket, testbeds: testbeds, sort_by: :name, sort_direction: :asc)} end def handle_event("toggle_sort_by_name", _params, socket) do current_direction = socket.assigns.sort_direction new_..."
16 April 2025
- 15:2415:24, 16 April 2025 diff hist +884 N Live View Store Data in URL Params Created page with "<source> defmodule AppWeb.PageLive do use AppWeb, :live_view def mount(_params, _session, socket) do {:ok, socket} end def handle_params(params, _uri, socket) do count = String.to_integer(params["count"] || "0") {:noreply, assign(socket, count: count)} end def handle_event("increment", _, socket) do new_count = socket.assigns.count + 1 # Use ~p instead of Routes {:noreply, push_patch(socket, to: ~p"/?count=#{new_count}")} end d..." current
8 April 2025
- 00:3300:33, 8 April 2025 diff hist −267 How to Create Nested LiveView Components No edit summary current
2 April 2025
- 20:4220:42, 2 April 2025 diff hist +823 User:Admin No edit summary current
- 20:3220:32, 2 April 2025 diff hist +794 User:Admin No edit summary
- 18:4218:42, 2 April 2025 diff hist +1,833 User:Admin No edit summary
- 18:4118:41, 2 April 2025 diff hist +893 User:Admin No edit summary
23 March 2025
- 21:4221:42, 23 March 2025 diff hist +1,322 Understanding Forms and Changesets No edit summary current
- 20:5220:52, 23 March 2025 diff hist +3,047 Understanding Forms and Changesets No edit summary
- 18:3218:32, 23 March 2025 diff hist +1,324 Understanding Forms and Changesets No edit summary
- 03:3403:34, 23 March 2025 diff hist +2,725 Understanding Forms and Changesets No edit summary
- 02:2802:28, 23 March 2025 diff hist +1,052 Understanding Forms and Changesets No edit summary
22 March 2025
- 22:0722:07, 22 March 2025 diff hist −1 Understanding Forms and Changesets No edit summary
- 22:0622:06, 22 March 2025 diff hist +1,766 Understanding Forms and Changesets No edit summary
19 March 2025
- 14:0814:08, 19 March 2025 diff hist +70 Understanding Forms and Changesets No edit summary
- 00:5000:50, 19 March 2025 diff hist +1,727 Understanding Forms and Changesets No edit summary
13 March 2025
- 18:3218:32, 13 March 2025 diff hist +1,393 How to Create Nested LiveView Components No edit summary
12 March 2025
- 14:4414:44, 12 March 2025 diff hist +1,583 Working with Sibling Components No edit summary current
- 13:5913:59, 12 March 2025 diff hist +1,151 N Working with Sibling Components Created page with "<source> defmodule Heading do use Phoenix.Component def head(assigns) do ~H""" <ul> <%= for heading <- @headings do %> <li phx-click="append_content" phx-value-heading={heading}>{heading}!</li> <% end %> </ul> """ end end #________________________________________________________________ defmodule Content do use Phoenix.Component def content(assigns) do ~H""" <p>This is content: {@content}!</p> """ end end #__..."
- 09:3809:38, 12 March 2025 diff hist +473 User:Admin No edit summary
11 March 2025
- 20:4720:47, 11 March 2025 diff hist +72 User:Admin No edit summary
- 20:0320:03, 11 March 2025 diff hist +87 User:Admin No edit summary
20 February 2025
- 23:2123:21, 20 February 2025 diff hist +208 User:Admin No edit summary
- 21:3221:32, 20 February 2025 diff hist +1,262 User:Admin No edit summary
29 December 2024
- 10:3010:30, 29 December 2024 diff hist +189 Understanding Forms and Changesets No edit summary
27 December 2024
- 09:2109:21, 27 December 2024 diff hist +419 N How to Think About Phoenix Dead Views Created page with "Each page (resource) has a route. These routes are assigned a controller and a function from that controller. In the code below, when a user goes to the "/" route a controller named PageController is found and a function named home is invoked. Controllers are simply modules and the third argument (in this case named '''home''') is a function on the controller. <source> get "/", PageController, :home </source>" current
- 09:1209:12, 27 December 2024 diff hist +39 Phoenix Flash Message No edit summary current
- 09:1209:12, 27 December 2024 diff hist +8 Phoenix Flash Message No edit summary
- 09:1109:11, 27 December 2024 diff hist +625 N Phoenix Flash Message Created page with "In Phoenix the flash message is invoked from the controller. <source> def create(conn, %{"doink" => doink_params}) do case Doinks.create_doink(doink_params) do {:ok, doink} -> conn |> put_flash(:info, "Doink created successfully.") |> redirect(to: ~p"/doinks/#{doink}") {:error, %Ecto.Changeset{} = changeset} -> render(conn, :new, changeset: changeset) end end </source> The message itself needs to be in the view..."
24 December 2024
- 03:2103:21, 24 December 2024 diff hist +1,278 User:Admin No edit summary
- 02:4702:47, 24 December 2024 diff hist +125 User:Admin No edit summary
23 December 2024
- 01:0901:09, 23 December 2024 diff hist +114 User:Admin No edit summary
- 01:0801:08, 23 December 2024 diff hist +62 User:Admin No edit summary
- 00:5700:57, 23 December 2024 diff hist +342 User:Admin No edit summary
8 December 2024
- 02:1602:16, 8 December 2024 diff hist +46 N Update Phoenix Generator Created page with "<pre> mix archive.install hex phx_new </pre>" current
29 November 2024
- 07:0407:04, 29 November 2024 diff hist +174 User:Admin No edit summary
25 November 2024
- 21:0721:07, 25 November 2024 diff hist +389 User:Admin No edit summary
24 November 2024
- 00:2500:25, 24 November 2024 diff hist +3,740 User:Admin No edit summary
- 00:2300:23, 24 November 2024 diff hist +689 User:Admin No edit summary
11 October 2024
- 15:0115:01, 11 October 2024 diff hist +1 User talk:Admin No edit summary current
- 15:0115:01, 11 October 2024 diff hist +1,242 User talk:Admin No edit summary
10 October 2024
- 17:2417:24, 10 October 2024 diff hist +3 User talk:Admin No edit summary
- 17:2417:24, 10 October 2024 diff hist +227 User talk:Admin No edit summary
21 August 2024
- 14:2114:21, 21 August 2024 diff hist +420 User:Admin No edit summary
- 14:1314:13, 21 August 2024 diff hist +952 User:Admin No edit summary
17 August 2024
- 07:1707:17, 17 August 2024 diff hist +25 N Kill Erlang Processes Created page with "pgrep erl | xargs kill -9" current
16 August 2024
- 15:2015:20, 16 August 2024 diff hist +53 N How to Install Elixir / Erlang on Ubuntu Created page with "https://thinkingelixir.com/install-elixir-using-asdf/" current