I am trying to replace the default homepage (public/index.html) to one of my controllers. I deleted the file in ''public/index.html'' created a controller called ''site'' and added this line to my ''routes.rb'' file... map.connect '''', :controller => ''site'', :action => ''index'' But when I go to my root URL ''http://staging.mysite.com'' I get a 404 error. I tested my controller by going to ''http://staging.mysite.com/ site'' and ''http://staging.mysite.com/site/index'' and it works fine, and displays the correct page. Any ideas why the routing isn''t working? This seems like this is very basic, and should be a piece of cake. -Adam D. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It was working all along. I didn''t realize you have to restart the application after every change. -Adam D. On Jan 12, 8:09 pm, "Adam D." <a...-O/BWLSZCs/Iz9h7fjEe8Mw@public.gmane.org> wrote:> I am trying to replace the default homepage (public/index.html) to one > of my controllers. > > I deleted the file in ''public/index.html'' created a controller called > ''site'' and added this line to my ''routes.rb'' file... > > map.connect '''', :controller => ''site'', :action => ''index'' > > But when I go to my root URL ''http://staging.mysite.com''I get a 404 > error. I tested my controller by going to ''http://staging.mysite.com/ > site'' and ''http://staging.mysite.com/site/index''and it works fine, > and displays the correct page. > > Any ideas why the routing isn''t working? This seems like this is very > basic, and should be a piece of cake. > > -Adam D.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 12, 5:30 pm, "Adam D." <a...-O/BWLSZCs/Iz9h7fjEe8Mw@public.gmane.org> wrote:> It was working all along. I didn''t realize you have to restart the > application after every change.You don''t have to restart the server after every change, but you do have to restart if you change routing. ///ark --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---