jaeyson
Programming Phoenix LiveView B.7: live_modal to live_component (page 101)
Programming Phoenix Liveview: live_modal to live_component (page 101)
Hi, First of all thank you for this awesome book.
I saw minor change for live_modal. If someone encounters an undefined function live_modal/2:
change from:
<%= if @live_action in [:new, :edit] do %>
  <%= live_modal PentoWeb.ProductLive.FormComponent,
    id: @product.id || :new,
    title: @page_title,
    action: @live_action,
    product: @product,
    return_to: Routes.product_index_path(@socket, :index) %>
<% end %>
to:
<%= if @live_action in [:new, :edit] do %>
  <%= live_component PentoWeb.ProductLive.FormComponent,
    id: @product.id || :new,
    title: @page_title,
    action: @live_action,
    product: @product,
    return_to: Routes.product_index_path(@socket, :index) %>
<% end %>
I created a new liveview project (0.17.10) and here’s the modal:
<%= if @live_action in [:new, :edit] do %>
  <.modal return_to={Routes.product_index_path(@socket, :index)}>
    <.live_component
      module={PentoWeb.ProductLive.FormComponent}
      id={@product.id || :new}
      title={@page_title}
      action={@live_action}
      product={@product}
      return_to={Routes.product_index_path(@socket, :index)}
    />
  </.modal>
<% end %>
 
  	            Marked As Solved
SophieDeBenedetto
									Author of Programming Phoenix LiveView
			          
						Hello and thanks so much for sharing this for other readers! We’re working on the next Beta release over the summer and that new release will include all the upgraded code.
	                    1
	                
	                
	            Also Liked
SophieDeBenedetto
									Author of Programming Phoenix LiveView
			          
						Hello again! Yes we will be updating all of the modal-related code.
	                    1
	                
	                
	            Popular Pragmatic Bookshelf topics
                        
                      
                      
                Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
              
            
            
          
              New
                The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
              
            
            
          
              New
                Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
              
            
            
          
              New
                Hi Travis! Thank you for the cool book! :slight_smile: 
I made a list of issues and thought I could post them chapter by chapter. I’m rev...
              
            
            
          
              New
                Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on  (page 64) 
If you follow the defau...
              
            
            
          
              New
                When I run the coverage example to report on missing lines, I get: 
pytest --cov=cards --report=term-missing ch7
ERROR: usage: pytest [op...
              
            
            
          
              New
                When running tox for the first time, I got the following error: 
ERROR: InterpreterNotFound: python3.10 
I realised that I was running ...
              
            
            
          
              New
                Title: Agile Web Development with Rails 7: (page 70) 
I am running windows 11 pro with rails 7.0.3 and ruby 3.1.2p20 (2022-04-12 revision...
              
            
            
          
              New
                Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
              
            
            
          
              New
                Hello faithful readers!  If you have tried to follow along in the book, you are asked to start up the dev environment via dx/build and ar...
              
            
            
          
              New
Other popular topics
                        
                      
                      
                I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
              
            
            
          
              New
                I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: 
The Ser...
              
            
            
          
              New
                I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
              
            
            
          
              New
                Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
              
            
            
          
              New
                Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
              
            
            
              
          
              New
                Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
              
            
            
          
              New
                Author Spotlight 
Dmitry Zinoviev 
@aqsaqal 
Today we’re putting our spotlight on Dmitry Zinoviev, author of Data Science Essentials in ...
              
            
            
          
              New
                Author Spotlight 
Rebecca Skinner 
@RebeccaSkinner 
Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
              
            
            
          
              New
                Author Spotlight: 
Peter Ullrich 
@PJUllrich 
Data is at the core of every business, but it is useless if nobody can access and analyze ...
              
            
            
          
              New
                Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
              
            
            
              
          
              New
Latest in Programming Phoenix LiveView
Categories:
Sub Categories:
Popular Portals
- /elixir
 - /rust
 - /ruby
 - /wasm
 - /erlang
 - /phoenix
 - /keyboards
 - /python
 - /rails
 - /js
 - /security
 - /go
 - /swift
 - /vim
 - /clojure
 - /emacs
 - /haskell
 - /java
 - /svelte
 - /onivim
 - /typescript
 - /kotlin
 - /c-plus-plus
 - /crystal
 - /tailwind
 - /react
 - /gleam
 - /ocaml
 - /flutter
 - /elm
 - /vscode
 - /ash
 - /opensuse
 - /html
 - /centos
 - /php
 - /zig
 - /deepseek
 - /scala
 - /sublime-text
 - /lisp
 - /textmate
 - /react-native
 - /nixos
 - /debian
 - /agda
 - /kubuntu
 - /arch-linux
 - /django
 - /deno
 - /revery
 - /ubuntu
 - /spring
 - /nodejs
 - /manjaro
 - /diversity
 - /lua
 - /julia
 - /c
 - /slackware
 
    





