I want to use form_for to allow a user to submit a form that contains two
instances of the same model. They are entering calendar dates and I want
them to be able to submit 2 from the same form.
Ok, so, using form_for, what is the best way to do this? form_for seems to
be setup to handle a single instance in that it wants a name for the
variable, etc...
Has someone else done this? Any quick pointers?
Beyond that, a related question. Some of these helpers support the :index
option which I believe is designed to differentiate between multiple items
of the same type in a form.
I want to use form_for to allow a user to submit a form that contains two
instances of the same model. They are entering calendar dates and I want
them to be able to submit 2 from the same form.
Ok, so, using form_for, what is the best way to do this? form_for seems to
be setup to handle a single instance in that it wants a name for the
variable, etc…
Has someone else done this? Any quick pointers?
Take a look at fields_for. Use it within a form (whether form_for or form_tag).
Beyond that, a related question. Some of these helpers support the :index
option which I believe is designed to differentiate between multiple items
of the same type in a form.
I have a very weird problem where no one can connect to my server ("foo.com"), even though DNS is working.
I'm running my rails app on port 8000 using this command:
# ./script/server webrick --port=8000 --environment=production
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:8000
=> Ctrl-C to shutdown server; call with --help for options
[2006-09-27 23:06:42] INFO WEBrick 1.3.1
[2006-09-27 23:06:42] INFO ruby 1.8.4 (2005-12-24) [i386-linux]
[2006-09-27 23:06:42] INFO WEBrick::HTTPServer#start: pid=1345 port=8000
When someone tries to access http://foo.com:8000 from a remote location, their browser refuses to connect. I've tried it myself using lynx and wget and see these errors:
lynx says: "Alert! Unable to connect to remote host."
wget says: "connect: No route to host"
If I telnet to foo.com on port 8000, telnet says:
"telnet: Unable to connect to remote host: No route to host"
However, I can ping foo.com successfully, and nslookup resolves it successfully too. If I re-run webrick on port 3000 (the default) everything works fine.
Anyone know why I can't choose a nonstandard port for my rails server to run on? This is really stumping me. Any tips would be very appreciated!