Abram
Abram

Reputation: 41844

Create multiple objects (of similar type) with single form

Let's say I have a form for adding names and photos of dogs.

I would like to add up to 10 dogs on a single form.. and have any blank fields ignored...

How can I actually create such a form, and what would the controller action look like that would handle the form?

Thanks in advance

Upvotes: 1

Views: 639

Answers (1)

varatis
varatis

Reputation: 14740

It seems like you'd want a sort of dynamic form, like Ryan Bates does on this RailsCast: http://railscasts.com/episodes/197-nested-model-form-part-2

You might want to check out the previous episode for rejecting the blank "dogs" too.

Upvotes: 1

Related Questions