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)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay