sergio_101
We have a simple case where a form has two dropdowns. The options in the second rely on the choice of the first.
In rails, our go-to pattern for this was as follows:
- Create the template to render whatever the default state of the dropdowns is.
- Create an action that returns just the options tags for the submitted choice.
- Using JS, when the first selection box is changed, make an ajax call to that new action. On response, swap out the old DOM element containing the old options with the new options.
At first, I thought LiveView was the go to on this, but after looking at LiveView, it seems like the entirety of the app needs to be written as a LiveView app. This is not, and it’s already pretty massive. Too massive to make the adjustment.
Then, I thought Channels might be the answer, but it looks like channels is a way to talk server → client.
So, how are people doing this daily in the Phoenix world?
Thanks!
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
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
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
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
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
lucaong
If you do not want to use
LiveView, you can use the same pattern that you were using with Rails. I see nothing wrong with it in principles.That said, you do not need to convert the whole app to
LiveViewin order to use it in one specific place.sergio_101
OH! Does LiveView seem like overkill or more work to solve the above problem? I read up a bit on liveview, and it seemed like a great way to handle such things. But i didn’t know I could use it on such a limited basis
lucaong
LiveViewis definitely a good way to solve your problem. The docs even list it as one of the common use-cases:That said, it’s also perfectly fine to use plain JS for something like this. I’d say it’s up to you, maybe if populating this particular select box is your only need, and you feel more comfortable with plain JS, it might be overkill to introduce
LiveView. But if you think it might turn out to be useful in other cases too, this could be an opportunity to start to gradually adopt it.sergio_101
thanks so much for your input. This phase has some serious deadline issues, so I will probably use JS.. but Phase II is a little more open, so I will figure out how to do this.
Thanks!