D
D
Dmitry2015-11-25 16:06:22
Ruby on Rails
Dmitry, 2015-11-25 16:06:22

How to add and save multiple elements on the same page with the form of one common element?

b07a672ba5f04e379ce6dd5b6f1b800c.png
(in the figure, a simplified fictitious task)
Task: right in the new / edit form of one model (Vitrina), it was possible to create an arbitrary number of elements of another model (Product). Preferably without AJAX. The minimum is to be able to create one new additional Product in the form in edit mode and be able to delete any of the existing ones.
With AJAX it is even more or less clear. But I want AJAX to be just an enhancement, not the main functionality... Maybe there are best practices? I just do not know how to search for this technique correctly ... what keywords?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
N. Bekseitov, 2015-11-25
@svetozar

Railscasts Nested Model Form (revised)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question