I was converting your blog post to a LiveBook:
# One-to-Many LiveView Form
## Interactive Example
<!-- [KobrakaiWeb.OneToManyForm] -->
## The schema
To start from the beginning – we'll need a schema to power our form. There
are schemaless changesets, but the `Phoenix.HTML.Form` implementation for
changesets don't support nested forms using schemaless changesets. Given
the example shown here is in memory only we'll be using an embedded schema,
but a database-backed schema works just as well.
Phoenix 1.7 added support for plain maps powering forms, which seems like a
viable alternative as well. That option won't be discussed here as part
of updating this blog post though.
defmodule GroceriesList do
use Ecto.Schema
embedded_schema do
field(:email, :string)
embeds_many :lines, Line, on_replace: :delete do
field(:item, :string)
field(:amount, :integer)
end
end
end
It gave similar output to the .md
file, however, the metadata was getting removed or I have to put it in some markdown block, which placed it away from the top of the file.
---
title: "Unnest for runtime sorted results"
tags:
- blog
- programmierung
language: EN
excerpt: |
How to get a dynamic list of items into an ecto query without storing it in the database.
---
I don’t know if Nimble Publisher can read this metadata if those values are placed anywhere else.
Oh no, I won’t dare to do that yet.
I was just thinking if I can do basic live component integration like you have done.
And perhaps later we can have Kino-based Smart Cell to enable blog editor-like features.