Show data in nested associted

Greetings! Just learning nested associations and this question araised a few days ago. So I have three associated tables:

        artists ← albums ←albums_tracks(it`s a join table) -> tracks

Lets propose for this current example artists : albums have 1:1 relations. And we have many-to-many relations between albums and tracks. We pass the artists changeset to the phoenix template and show the albums and artist`s fields. Like that:

<%= form_for @changeset, "#", fn f-> %>
fields of "artists table"
 <%= inputs_for f, :albums, fn f2 -> %> 
  <%= label f2, :albums_field %>
  <%= text_input f2, :albums_field, phx_debounce: "blur" %>
  <%= error_tag f2  , :albums_field %>
<% end %>
<% end%>

How to show my track table`s fields?

The docs for inputs_for/3 have an example for how to handle a nested list of items. Though I always found it awkward to handle nested lists in a single form.

Seems like you’re trying to edit an artist, album and all of it tracks in one form - I don’t think this is great UX. If these entities can be updated separately, then I think it would be best to have separate forms for them.