Hunter
2006-May-02 16:35 UTC
[Rails] Ruby on Rails w/Dreamhost - routes problem...I think.
I am trying to deploy my first app on Dreamhost using Ruby on Rails. I followed the wiki, but I think I am missing something. I think it may be in my RoR code, but I am not sure. My app runs fine when run as http://localhost:3000/AddPatientVisit/addvisits AddPatientVisit is the controller and addvisits is the form that posts back to the controller. I got rid of the index.html in public (it did get served up before I deleted it). I think my route is wrong, but I don''t know how to direct it to the page above. I should point out that my controller doesn''t have an index method, just an action that is called by the addvisits.rhtml when the user hits the "submit" button. Here is my route: map.connect '''', :controller => "AddPatientVisit" I am very much a noob at this, so thank you for your help! -- Posted via http://www.ruby-forum.com/.
Charlie Bowman
2006-May-02 16:41 UTC
[Rails] Ruby on Rails w/Dreamhost - routes problem...I think.
> My app runs fine when run as > http://localhost:3000/AddPatientVisit/addvisits > > AddPatientVisit is the controller and addvisits is the form that posts > back to the controller. > > Here is my route: > map.connect '''', :controller => "AddPatientVisit"try map.connect '''', :controller => "AddPatientVisit", :action => ''addvisits'' Charlie Bowman www.recentrambles.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060502/a269fe31/attachment.html
Al Evans
2006-May-02 16:56 UTC
[Rails] Re: Ruby on Rails w/Dreamhost - routes problem...I think.
Hunter wrote:> Here is my route: > map.connect '''', :controller => "AddPatientVisit"It looks to me like you''ll need map.connext '''', :controller => "AddPatientVisit", :action => "addvisits" --Al Evans -- Posted via http://www.ruby-forum.com/.
Hunter
2006-May-02 17:04 UTC
[Rails] Re: Ruby on Rails w/Dreamhost - routes problem...I think.
Al Evans wrote:> Hunter wrote: > >> Here is my route: >> map.connect '''', :controller => "AddPatientVisit" > > It looks to me like you''ll need > > map.connext '''', :controller => "AddPatientVisit", :action => "addvisits" > > --Al EvansThank you for the reply. I will try that. I was thinking the action had to be a method. The controller has a method called addvisit(singular) that I made part of the route originally. All that did was run w/o any parameters passed to it. I post back here with my results. -- Posted via http://www.ruby-forum.com/.
Hunter
2006-May-02 18:11 UTC
[Rails] Re: Ruby on Rails w/Dreamhost - routes problem...I think.
I tried that, but to no avail. Instead I put my "addvisits" code into an index.html file in the add_patient_visit folder in the app/views. Now the appropriate page shows up, but when I click the submit button, it can''t find the action addptvisit This setup works fine in webrick, so I am thinking it''s a route problem again?!? Thanks! -- Posted via http://www.ruby-forum.com/.
Hunter
2006-May-02 18:22 UTC
[Rails] Re: Ruby on Rails w/Dreamhost - routes problem...I think.
Hunter wrote:> I tried that, but to no avail. Instead I put my "addvisits" code into > an index.html file in the add_patient_visit folder in the app/views. > > Now the appropriate page shows up, but when I click the submit button, > it can''t find the action addptvisit > > This setup works fine in webrick, so I am thinking it''s a route problem > again?!? > > Thanks!Correction: The method in my controller that I need invoked is ''addvisit'' -- Posted via http://www.ruby-forum.com/.
Hates_
2006-May-02 22:59 UTC
[Rails] Re: Ruby on Rails w/Dreamhost - routes problem...I think.
> Correction: The method in my controller that I need invoked is > ''addvisit''Have you setup your form tag properly? <%= start_form_tag :controller => "AddPatientVisit", :action => "addvisits" %> -- Posted via http://www.ruby-forum.com/.
Hunter
2006-May-03 00:27 UTC
[Rails] Re: Ruby on Rails w/Dreamhost - routes problem...I think.
Hates_ wrote:> >> Correction: The method in my controller that I need invoked is >> ''addvisit'' > > Have you setup your form tag properly? > > <%= start_form_tag :controller => "AddPatientVisit", :action => > "addvisits" %>Hi Hates_, Thank you for the reply. I used the code below, which works in development, but I will try what you are suggesting. Thanks! <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> -- Posted via http://www.ruby-forum.com/.
Hunter
2006-May-03 02:07 UTC
[Rails] Re: Ruby on Rails w/Dreamhost - routes problem...I think.
Hates_ wrote:> >> Correction: The method in my controller that I need invoked is >> ''addvisit'' > > Have you setup your form tag properly? > > <%= start_form_tag :controller => "AddPatientVisit", :action => > "addvisits" %>Do these tags go outside or inside my <form>...</form> html tags? Thanks! -- Posted via http://www.ruby-forum.com/.
Hunter
2006-May-03 02:31 UTC
[Rails] Re: Ruby on Rails w/Dreamhost - routes problem...I think.
I used the code below, which works fine in WEBrick, but give me an application error when moved to the webserver. <html> <head> </br> </head> <body> </br> <%= form_tag(:controller => "AddPatientVisit", :action => ''addvisit'') %> 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> <%= submit_tag("Add Visits") %> <%= end_form_tag %> </body> </html> -- Posted via http://www.ruby-forum.com/.
Phillip Hutchings
2006-May-03 02:43 UTC
[Rails] Re: Ruby on Rails w/Dreamhost - routes problem...I think.
On 3/05/2006, at 2:30 PM, Hunter wrote:> </br>I hope you mean <br />, </br> isn''t valid, and no form of <br /> should be inside <head>. I suggest you fix your HTML first...> I used the code below, which works fine in WEBrick, but give me an > application error when moved to the webserver.An error. Good. _WHICH_ error? Copy/paste it. If there''s just ''500 internal server error'' find the logs, they''re in your rails application, check production.log. -- Phillip Hutchings phillip.hutchings@sitharus.com http://www.sitharus.com/