Pau Riosapaugramming.com·Feb 22, 2024Things I Learned using Phoenix LiveView in 2024 (Part 2)The beauty of assign_async/3 and async_result/1 # LiveView def handle_params(params, _uri, socket) do {:noreply, socket # ... more assigns here |> assign_async_coffees()} end # ... more code here defp assign_async_c...DiscussElixir
Pau Riosapaugramming.com·Feb 19, 2024Things I Learned using Ecto.Schema in 2024 (Part 1)The problem I have two schemas, coffees and orders wherein I want to get the recent completed order from each coffees First solution defmodule Schemas.Coffee do # ... more code has_many :completed_orders, Schemas.Order @spec coffee_query...Discuss·40 readsElixir
Pau Riosapaugramming.com·Feb 15, 2024Things I Learned using Phoenix LiveView in 2024Use handle_params/3 more often rather than mount/3 for assigning. def mount(_params, _session, socket), do: {:ok, socket} def handle_params(params, _uri, socket) do {:noreply, socket |> assign_here_1(params) |> assign_here_...Discussphoenix liveview
Sergio Tapiasergiotapia.com·Jan 11, 2024Direct File uploads with Phoenix Liveview and Cloudflare R2.It's been really hard to figure this out and I had to cobble together many sources to get it working. Enjoy! We're going to build a direct image upload to Cloudflare B2 from the browser. That way the file doesn't travel to your servers and slow them...Discuss·62 readsphoenix liveview
AbulAsar S.abulasar.com·Jan 9, 2024Adding PDF generate feature in Phoenix LiveView appGenerating pdf is very common in day-to-day web applications. In E-commerce websites like Amazon when we do any shopping we get the option to get the invoice. It's not an easy task to implement it people often have a hard time implementing it because...Serguei Cambour and 1 other are discussing this2 people are discussing thisDiscuss·2 likes·2.0K readschromicpdf
AbulAsar S.abulasar.com·Jan 4, 2024TIL: How to add a form in a table in Phoenix LiveView?Suppose, we want to add an inline edit feature on a table row. It can be a little tricky to implement. I had a hard time implementing it because I wasn't about one of the concepts of HTML that we cannot add a form tag inside a table. Something like t...Discuss·1 like·108 readsToday I learnedforms
AbulAsar S.abulasar.com·Jan 3, 2024TIL: Add the "download" attribute on the link tag when calling the download endpointDownloading pdf or any other documents is very common in day-to-day web applications. We often see buttons like Download, Generate Invoice, etc buttons in web applications that makes calls to a GET endpoint which does some computations and downloads ...Discuss·1 like·127 readsToday I learnedtoday i learn
Aashish Chakravartyaashishchakravarty.hashnode.dev·Aug 25, 2023Creating Constant Modules in ElixirElixir, a functional programming language built on top of the Erlang Virtual Machine (BEAM), offers developers a powerful and flexible environment for building scalable and fault-tolerant applications. One common requirement in software development i...DiscussElixir
David Hewittdavidmhewitt.hashnode.dev·Aug 1, 2023Integrating Mapbox into a Phoenix 1.7 Project - Part 2 - Receiving events in Phoenix from MapboxIn Part 1, we explored the basic integration of Mapbox into a Phoenix project, getting the necessary libraries installed and a map displayed. In this part, we will explore passing an event, such as the user moving a marker, back to Phoenix LiveView. ...Discuss·40 readsIntegrating Mapbox into a Phoenix 1.7 ProjectPhoenix framework
Miguel Cobáblog.miguelcoba.com·May 23, 2023Editing forms with live_file_inputImagine you are writing an app to handle products for a marketplace. Each Product has up to 3 images associated with it. When editing a Product, you should be able to remove any of the already associated images and add new images to the Product, alwa...Discuss·10 likes·1.7K readsElixir