RooSoft
Could it be possible to use a <.link> in a LiveView page, and include data that has to make it to the next page?
Thing is, the current page could be selecting stuff that’s too large to fit into an URL… I’d like the next page to get that info, maybe via the HTTP body or something…
What’s the best way to achieve this?
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
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
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
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
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
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
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
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
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security











Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
benwilson512
A simple link is always a GET request, which does not have an HTTP body. Can you elaborate on your use case a bit more? What is the information you’re trying to send?
RooSoft
We’re talking about a Bitcoin transaction containing possibly hundreds of outputs that can be reduced to ~ 64 bytes each. So, that page would enable the user to select some to create a new transaction out of these.
Best case scenario, we’d then end up in a LiveView page with the :new live action, already knowing which of those previous outputs will serve as inputs in the new transaction.
It’s pretty much a chaining process, but with an arbitrary number of links.
benwilson512
Gotcha. Does the link need to take them to a totally different
live_viewor could it be apatch? You could have the selection content be a component with a form or something, and then when you submit that form, the liveview can hold onto that data in its state, and then render the next “step” of the form, and save the chosen contents in a hidden form field or just in its process state.RooSoft
So you’re in short suggesting that this could be turned into a wizard, right?
Could be… maybe I was trying to separate things too much…
Thing is, the original page was thought as a Transaction :show page… I was thinking about going towards a Transaction :new page… Maybe this process should start from something else, such as an output selection page, and start from there. It feels like an extra navigation step for the user, though.
Bitcoin is a complicated thing, and my goal is to simplify things.
benwilson512
It sort of sounds like you’re building one, so you could consider leaning into it. Maybe make the
newthing a modal?Stepping back to the link thing: Are you making a new transaction out of some sub-set of the outputs? Could you “compress” the information by, instead of sending the full 64 bytes instead send the “index” of the output? Eg if you have
and you want to make a new transaction based on long thing 1 and long thing 4 you could put the transaction ID in the URL, and then just the indexes of those other values
[0, 3]. The hashes are all sortable, and the transaction is immutable, so the combination of the transaction and the indexes should be deterministic. This should dramatically increase how many things can fit in your URL.Of course your final option here I suppose is to use
send_eventto push a message to JS, and have the JS shove the data in local storage keyed off the transaction id.RooSoft
You are right to think that those 64 byte hashes can be reduced to an index… they always show up in the same order in a given transaction. That would make it possible to potentially create a querystring carrying that info in a pretty compact way. Still, somebody made a crazy transaction with ~1000 inputs a couple of weeks ago, and that would still break the ~2000 bytes URL size limit with the concept we’re talking about.
I will sleep on this, the idea of a wizard could also be a good one… I am just keeping the focus on the least amount of operations to get the job done, so most users end up thinking it feels natural.
Thank you ben, you help is very enlightening!
benwilson512
+1. I think the whole show/new/edit/etc paradigm is a good one to get going, but as you figure out the workflows that your users actually need to do I’m a big fan of just building those workflows where they make sense. If people want to go look at a transaction and seamlessly initiate a new transaction then I say put a form on
showto make it easy.