Add Tags with Ecto has_many, through in Phoenix - Tagging part 1
I want to add tags to products. And as usual there are a situation where a product can have many tags and a tag can belong to many products. Howeve..
Add an use a JSONB field in Phoenix and Ecto
PostgreSQL has native support for objects stored as JSON as actually binary JSON (or JSONB). With JSONB format, you can add index do the column for ..
Nested model forms with Phoenix LiveView
I my last article, I set up a relationship between products and variants. But what I didn't go through was to setup a form where you can manage the ..
Setup a has_many / belongs_to in Phoenix
Something I do in EVERY project is to setup some sort of relation between resources. And even though Phoenix comes with generators for migrations an..
Create a Bootstrap Like Modal with Tailwind and Alpine.js
In certain scenarios, it doesnt really make sense to use LiveView. That can be toggling dropdowns, tabs, accordions and opening modals. There is a g..
Send events from JS to a LiveView component
Let say you app uses a javascript library that needs to interact with your app. For example a LiveView component. That is possible with the built in..
Phoenix LiveView and Invalid CSRF token
One issue that is common to run into is a CSRF error when posting some sort of form rendered with LiveView. The issue is that a LiveView component i..
Pagination with Phoenix LiveView
Let say you have a long table that you want to paginate with Phoenix LiveView. In this tutorial, I have an existing table with 100 entries that I wi..
Typeahead with LiveView and Tailwind
In this tutorial I want to show how easy it is to do an autocomplete or typeahead without any additional javascript!