So I'm creating a simple application. I have a 'Games' database table and a 'Rules' database table. Each game can have many rules. I want to present a form like this:
Game Title:
Game Description:
Rule #1:
(Click to add another rule)
So the user can click a button to add another text field for additional rules. What is the best way of going about this? Are there form helpers? Any way to return an array of rules? I'm somewhat new to Rails, and my googling didn't provide much help. I may just be being ignorant, but any help would be greatly appreciated!
What you are looking for are called "dynamic forms" and the answer to your question is in the following Railscasts episode.
Its kinda late but i hope it helps someone else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With