I am new to rails and ruby and I know that this question looks like it has been asked before. But the solution to most have been provided using nested forms using fields_for tag. I am not sure if this is what I want.
I have a form in which I take input from user about the kind of sports that he plays using the following tag <%= f.text_field :sport ,placeholder:"Enter Sport"%>. Now I have a button which can create multiple copies of this textbox using javascript so that the user can enter multiple sports that he plays.
Can you please explain how should I write :sport so that I can get all the sports info in an array. With the current way that I am using the :sport variable, I think it will get overwritten when user inputs value in a new textbox
Aucun commentaire:
Enregistrer un commentaire