cobra
I’m looking for a way to generate liveviews but with Ash resources instead of the normal ecto schemas?
Thanks in advance ![]()
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
In the
AshPhoenixpackage there are liveview generators: mix ash_phoenix.gen.live — ash_phoenix v2.3.23cobra
Why I love Elixir

Thanks Zach
Chrichton
I used mix ash_phoenix.gen.live and it worked nicely!
Could you please tell me, what my routes have to look like?
Thanks for your help, Heiko
Chrichton
I created a Phoenix LiveView app using Ash with the following steps:
mix archive.install hex phx_new
mix igniter.new tuneshg \
–install ash,ash_postgres,ash_phoenix \
–with phx.new \
–extend postgres \
–example
Link:
HexDocs Ash Getting started
Create Domain and Resource
mix ash.gen.domain Tuneshg.Music
mix ash.gen.resource Tuneshg.Music.Artist --extend postgres
Define attributes and actions for resource (Music/Artist)
Create migrations - mix ash.codegen create_artists
Run migrations - mix ash.migrate
Generate LiveView
mix ash_phoenix.gen.live --domain Tuneshg.Music --resource Tuneshg.Music.Artist --resourceplural artists
The generated code required to define many routes
Why?
Here my routes:
live “/”, ArtistLive.Index
live “/artists”, ArtistLive.Index
live “/artists/new”, Artist.FormLive, :new
live “/artists/:id”, ArtistLive.Show
live “/artists/:id/edit”, Artist.FormLive, :edit
live “/artists/:id/show/edit”, Artist.FormLive, :edit
The live_action was not added to the socket
Where is the live_action normally set?
Am I doing something wrong/is there a better way?
Thanks for your reply, Heiko
zachdaniel
There was a bug in a recent release of
ash_phoenixthat prevented it from printing the routes. I’m releasing a fixed version shortly. So now it should tell you which routes to addChrichton
I am working through the new Ash Book from PragPro.
I am trying to follow the book by creating the app from scratch.
I was using ‘mix ash_phoenix.gen.live’ to generate the LiveView from the resources, but that created a LiveComponent, while the example code in the book works mostly with liveviews.
I have two questions:
Thanks for your answer, Heiko
zachdaniel
While learning to use the LV generator is great, the book was not designed to dovetail off of that generator really. I’m happy to work with you on questions about those generators, but you’re definitely making it harder on yourself by not following the books intended path more closely. There are a lot of concepts that it aims to teach and the focus is not on Liveview. Liveview is primarily a delivery mechanism to teach you about Ash in this context.
Now, the resource LV generator in ash_phoenix should create both a Liveview and a live component for the form. Is that not what you’re seeing?
Chrichton
Sorry, I didn’t that.
I will have a closer look now.
Thanks Zach
Chrichton
After taking a fresh look, I can clarify my question about the generator:
The generator creates Lifeviews to list, show, edit and delete artists.
AND it create a LiveComponent == FormLive to do the actual editing.
My question is about this Component. Why isn’t it a normal LV?
In the Tunez-App in your book you are using a LiveView == FormLive, which is the way, I would have done it. So the question was: Why is the generator not doing the same??
That way I had to convert the LV-Code of the book to my LiveComponent.
Otherwise it would have been easy-peasy.
But I learned a lot by doing so.
I also ran into one problem which I don’t understand:
The book-code of FormLive looks like this:
So I converted that to:
That looked correct, but later, when I tried to edit an album and typed, I got:
I modified my code to:
using AshPhoenix.Form.for_update, that I used before and everything worked again.
I don’t know, why the two methods are not equivalent, but I think you do
My last point:
the code in your book and from chapter 3 on, I decided to accept your proposal and follow the book using the Tunez-Code.
Yes, you are right, I am making it harder for me to follow
Again, dear Zach, thanks a lot for your patience and your time helping me and explaining so superbly, Heiko
zachdaniel
Honestly the LiveView generator was copied directly from phoenix’s generator at the point in time that they were when we made the LiveView generator
. Ultimately we just want to do whatever LV is doing with their generators, but calling into Ash code instead of Ecto code.
I haven’t looked to see how out of date they are.