Dynamic forms with drab

Hi,

i have a form that has a list of nested subforms. i want to add and remove subforms dynamically with buttons.
i found the awesome https://github.com/grych/drab for that.

removing a subform is not a problem of course, but i wondered if there is an elegant solution to add a subform via drab serverside instead of writing custom js? Phoenix.View.render_to_string can render my template but how am i supposed to add the outer function for “inputs_for f” and the other arguments? will it even work theoretically? Maybe anybody else tried the same.

thanks!

Maybe Unpoly can help you with that.

Thanks, but i think not, i want to create possible infinite numbers of subforms, unpoly has triggers for everything but does not seem to help me generate the form.