coen.bakker
Quick question.
I have been reading up on using forms in LiveView. I come across the error_tag/2 function often (for example in this 2022 article by Sophie DeBenedetto) but in the latest official documentation I cannot find any mention of it.
Is error_tag/2 deprecated?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
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
I think I’ve found a small improvement I could contribute to <%= web_namespace %>.CoreComponents (installer/templates/phx_web/compo...
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
ICal is a library for interacting with iCalendar data. It parses iCalendars into typed Elixir structs via ICal.from_ics, and can prepare ...
New
Latest Phoenix Threads
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
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
josevalim
error_tag was always part of your app. So you can just add something that does the same to your app. IIRC it was just an error string wrapped in a span tag.
coen.bakker
Yes, I believe it used to be injected into any project scaffolded with
mix new, inside ErrorHelpers.ex. I reckon that it has been removed from themix newboilerplate code, in favour of theerror/1function component that’s part of thecore components? Which also basically also just a wrapper.josevalim
Yes, that tracks!
smathy
It’d be nice if all bloggers led off with the versions of stack they’re using
The 1.7 release at the start of 2023 was a big change: components and verified routes involved a lot of changes to the view templates. So you’re going to need to account for that when reading any blog from 2022 or earlier. The official changelog is a great source of lots of information about those changes.
coen.bakker
Awfully off topic, but would you ever say “yes” to being on Lex Fridman’s podcast?
N.B., I have no ties to him. But I like the idea of being able to tune into a long form, uncut interview.
josevalim
Sure! My arm appreciates as many breaks as possible, especially long ones.
silverdr
It was defined as follows:
So… I now have
error_tag/2all over my application. Wondering if I could easily change this to use the latest approach, including translations and w/o replacing all thoseerror_tags scattered across large number of files/forms. How would you experts do it? Any caveats/gotchas to expect? Yes, I know there’s the “shim”, utilising which should do the trick I presume, but I think of taking a step towards the LiveView 1.0.x approach, while still w/o replacing all those occurrences.LostKobrakai
Replacing this shouldn’t be much of a problem. Most functions in
Phoenix.HTML(includingcontent_tag) return data for which thePhoenix.HTML.Safeprotocol is implemented. The data you get from~Hsigils also has a implementation of that protocol. This error_tag function returns a list of safe data, but the protocol for implementation for lists just iterates nested safe data, so returning the results of a single~Hshould generally also be fine.You might have places in your codebase, which depend on the return value being a list or even dig deeper into the results, but I’d argue those would be worth fixing and I wouldn’t expect many of such in a codebase.
silverdr
I don’t recall ever using it in a deeply unusual way. Differences might be mostly (if not only) in the placement I believe. Either right next/under the corresponding input or grouped into errors summary boxes. Shall have a stab at replacing the implementation then and see how it goes, thank you.