On Fri, Nov 06, 2009 at 08:33:02PM -0800, eggie5 wrote:
> So here I have a form where I can create a dog in the DB. How do I
> create a form (and the respective controller code) to create 2 or 3
> dogs?
While I'm admittedly a rails newcomer--and probably destined to go back
to PHP if I can't get some traction on some of my own forms issues--I
can think of two practical ways to go about this:
1. Have a successful create add some feedback to flash[:notice] and
redirect to another dog entry form. As long as the session (or
some other mechanism) is populating a foreign key into each dog
object so you can find the records again, you could do this an
arbitrary number of times.
2. Use AJAX to get the number of dogs you want to enter, and then
create a nested form for each one.
Maybe some of the more experienced rails folk will have better
suggestions for you.
--
"Oh, look: rocks!"
-- Doctor Who, "Destiny of the Daleks"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---