Re:Phlex for Rails Emails: Action Mailer Without ERB
by dewey on Monday March 03, 2025 @08:41AM
(#43241608)
There's a general pattern of:
I feel like the solution to both of these is just to stick to SQL / HTML as for both of these there's a lot of resources, tooling and knowledge and they will not go away. They are transferable between languages, projects and whatever tooling companies are using.
[ Parent
| on HN ]
Re:Phlex for Rails Emails: Action Mailer Without ERB
by MyOutfitIsVague on Monday March 03, 2025 @11:11AM
(#43243164)
HTML, yes, but SQL has another major problem in that it's not composable. HTML can be broken into fragments, but it's very difficult to work with and write reusable SQL in a modular way. CTEs and views help a bit, but they are not a great answer to the fact that SQL statements almost always have to be treated as an indivisible chunk.
I like SQL alright from a functionality perspective (the syntax leaves much to be desired), but I still use ORMs where appropriate just to be able to modularize and make reusable behavior where it makes sense.
Re:Phlex for Rails Emails: Action Mailer Without ERB
by 3by7 on Monday March 03, 2025 @10:45AM
(#43242844)
And
- People inventing new technologies to not write JS
- People inventing new technologies to avoid writing CSS
Re:Phlex for Rails Emails: Action Mailer Without ERB
by joeldrapper on Monday March 03, 2025 @01:56PM
(#43245342)
How do you write an each loop or a conditional in HTML?
Re:Phlex for Rails Emails: Action Mailer Without ERB
by dajonker on Monday March 03, 2025 @03:29PM
(#43246324)
It's a necessary evil, isn't it? You're not programming your application in pure HTML or SQL, you write it in some general language that can do much more. But the browser and database don't speak that language natively. They want strings which they then turn into something useful. So you need to build these big strings and unless your application is completely static, you'll need string interpolation one way or another.