Render form fields from a foreign key in a live component

Hi all

I have an Ecto schema S with a fk to a schema E.

In a live component, I would like to render form fields for S plus the fields of E.

Schema S is in a reusable library L, schema E is changing for every Phoenix project that uses L.

How can I render all the E fields dynamically?

Thank you

First you will need to preload the data from E into S. Then you can use <.inputs_for :let={e} field={@s[:field]}> to get at the fields in S. But then you will need to write some rendering logic that will be able to read all those fields and generate the inputs, there is no default automatic way to do this.