4 ms·
I haven't used Elixer but tt's generally a good idea for the UI to have a different data model than the database (even if it means you initially type almost the
by bbkane 4mo ago
I haven't used Elixer but tt's generally a good idea for the UI to have a different data model than the database (even if it means you initially type almost the same thing twice and have to write a tedious translation layer).
This lets you evolve each part independently and use the "native" types frontend vs backend, which happens surprisingly frequently as the app grows
- Kaliboy 4mo agoPhoenix does have that. ViewModels. I don't think its required to use though, but we always do.
- neya 4mo ago> but tt's generally a good idea for the UI to have a different data model than the database You're not wrong and most other comments are responding this from some sort of UI library perspective, like React / Svelte. However, if you're using even the barebones scaffolded UI using LiveViews from Phoenix, you don't have to do any of these. Phoenix will wire up the form to the changesets by default. Which is what I'm referring to.