Forum: Ruby on Rails Route problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Hunter (Guest)
on 2006-05-03 01:37
I have an index.rhtml is rendered when the (main)controller is loaded.
The page contains some check boxes and a submit button.  See form code
below. When I click the submit button, I get a 404.  I don't know how to
post this data back to my controller where method "addvisit" is waiting.
It works in WEBrick no problem, but doesn't work in fcgi on DreamHost.
I am guessing I just know how to make the route connection.  I have this
route in there and that worked for rendering the index page
  map.connect '', :controller => "AddPatientVisit"

I add this line below it, but it doesn't seem to do anything.
  map.connect '', :controller => "AddPatientVisit", :action =>
"addvisit"

Here is the last production.log entry:
ActionController::RoutingError (Recognition failed for "/addvisit"):
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:469:in
`recognition_failed'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:459:in
`recognize!'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in
`dispatch'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:141:in
`process_request'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in
`process!'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
`each_cgi'
    /usr/lib/ruby/1.8/fcgi.rb:597:in `each'
    /usr/lib/ruby/1.8/fcgi.rb:597:in `each_cgi'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
`process!'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:in
`process!'
    dispatch.fcgi:25

Here is my index.rhtml code:

<html>

<head>

</head>
<body>
</br>

<form name="myform" action="addvisit" method="post">

   Patient #1<%= check_box("patient", '1', {:checked => 'checked'},
"yes") %></br>
   Patient #2<%= check_box("patient", '2', {:checked => 'checked'},
"yes") %></br>
   Patient #4<%= check_box("patient", '4', {:checked => 'checked'},
"yes") %></br>
   Patient #8<%= check_box("patient", '8', {:checked => 'checked'},
"yes") %></br>
   Patient #9<%= check_box("patient", '9', {:checked => 'checked'},
"yes") %></br>

</br>

<input type="submit" value="Add Visits">

</form>

</body>

</html>


Thank you for your help!

-Hunter
This topic is locked and can not be replied to.