DEV Community

Cover image for Phoenix LiveView, nested .inputs_for
Mykolas Mankevicius
Mykolas Mankevicius

Posted on

Phoenix LiveView, nested .inputs_for

TIL: You can nest .inputs_for in Phoenix LiveView forms to make inputs visually coherent.

Note: This is a simplified example.

<.inputs_for :let={profile} field={@form[:profile]}>
  <Fields.text field={profile[:first_name]} />
  <.inputs_for :let={images} field={@form[:images]}>
    <Fields.avatar field={images[:avatar]} />
  </.inputs_for>
</.inputs_for>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more