0
For my TCC project, I have the following specification:
A user, to register a production item, must inform all its ingredients. To facilitate interaction, I thought of, list all ingredients registered in checkboxes. When the user clicks on a certain link, a Javascript function will count the checkboxes marked, and then create in a div the text fields corresponding to each ingredient so that the user can enter the amount of each one.How accidental markings can happen, in the div with inputs, it should still be possible for the user to delete unwanted fields by clicking on a link.
My question is about the back-end. How do I save this in the database? How will I capture the quantities of each field if they are not previously created in the .html.erb file?
Hello, are you using version 4.1? Please enter your code! : D Thanks!
– Bruno Casali
Hi @Brunocasali I haven’t started implementing yet. I’m researching the best approach, and if this is possible before starting. As for your first question, yes, I am using the 4.1.
– Pedro Vinícius
Dude I’m starting with Rails too, I haven’t had to do this kind of form yet, I just had a few disagreements with forms of more than one model. But I found some links that I think can help you, comp-groups, stack, looked up 'Dynamic Forms in Rails 4' :D
– Bruno Casali