There are model recipes. The recipes need to add the ingredients which are stored in another table and linked via id. Model ingredients has the following fields: id, id_продукта, id_рецепта, the number and id_единицы measurement. Page creation-editing of the recipe, it looks like this:
The challenge is to right on the page of recipes you can add or delete the line with the ingredient. You can certainly come up with your bike, but maybe there are some ready solutions?