Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Dynamic Forms with Nested_Forms in Rails 4

My versions are: Simple_Form: 3.0.0 Devise: 3.2.2 Rails: 4 Ruby: 2 Bootstrap: 3.0.3

Hello i have a model with attributes make,model,year,part,part_info. I want a form where the user writes the make,model,year, part and part_info. But also i would like a button "Add Additional Part" when its clicked, two more inptus for part and part_info pop. The user will pop as many inputs he wants (maybe i ll have a limit to 10). Every part has to be a single entry in my database so if the user adds 3 additional parts he should have 4 part orders in his profile.

Here is an example http://young-eyrie-3135.herokuapp.com/getstarted

Any ideas how to do this? Thanks in advance.

1 Answer

Brandon, I was wondering if the way it is done in this video only applies to belongs_to/has_many relationships?

I have a Cover that has Logos on it and they have a has_many_has_many relationship, so in my Cover form, I am trying to specify all the Logo's that should be displayed for that cover, but I am very confused as to how to set up my relationships in order to not only select more logos from a dropdown on the cover form, but not have it so that a Logo is only associated with one Cover, but many in future Covers.

Appreciate any help!