The options for running Rails under WEBrick suggest that I can pass in the name of the default controller so that I get my correct application start page, rather than the welcome screen opts.on("-i", "--index=controller", String, "Specifies an index controller that requests for root will go to (instead of congratulations screen)." ) { |OPTIONS[:index_controller]| } I''ve tried numerous ways to set this value, yet I always get that Welcome to Rails page. None of these work for me: ruby script\server --index="pitches" ruby script\server --index=pitches ruby script\server -ipitches That last one appears to actual assign a value to OPTIONS[:index_controller], but that doesn''t seem to mean anything. When I call http://beta.mysite.com:3000 I just get "Congratulations, you''ve put Ruby on Rails!", rather than the index page for the ''pitches'' controller This is on Rails 0.10 and Ruby 1.8.2, 1-click on win2k I have this in my routes.rb map.connect '':controller/:action/:id'' , :controller => ''pitches'' map.connect '''' , :controller => ''pitches'' and it works fine using CGI. But not so well with WEBrick. Thanks, James
James Britt wrote:> The options for running Rails under WEBrick suggest that I can pass > in the name of the default controller so that I get my correct > application start page, rather than the welcome screen > > > opts.on("-i", "--index=controller", String, > "Specifies an index controller that requests for root will go > to (instead of congratulations screen)." > ) { |OPTIONS[:index_controller]| } > > > I''ve tried numerous ways to set this value, yet I always get that > Welcome to Rails page. > > None of these work for me: > > ruby script\server --index="pitches" > ruby script\server --index=pitches > ruby script\server -ipitches > > > That last one appears to actual assign a value to > OPTIONS[:index_controller], but that doesn''t seem to mean anything. > > When I call > > http://beta.mysite.com:3000 > > I just get "Congratulations, you''ve put Ruby on Rails!", rather than > the index page for the ''pitches'' controller > > This is on Rails 0.10 and Ruby 1.8.2, 1-click on win2k > > I have this in my routes.rb > > > map.connect '':controller/:action/:id'' , :controller => ''pitches'' > map.connect '''' , :controller => ''pitches'' > > and it works fine using CGI. But not so well with WEBrick. > > Thanks, > > > James > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Deleted or renamed the public/index.html file have you? Had that problem a couple of times now, when will I learn ;) // Regards JoNtE
On Tue, 15 Mar 2005 08:54:00 -0700, James Britt <james.britt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> map.connect '':controller/:action/:id'' , :controller => ''pitches'' > map.connect '''' , :controller => ''pitches''This is actually backwards. You want the :controller/:action/:id one to be last, always. it doesn''t *really* matter in this situation because those two routes can never be confused, but if in future you create a new route that has three options (:foo/:bar/:baz), then it won''t be used because the :controller/:action/:id one will take precedent. Just remember, they''re in the order that they would be processed, so whichever one is more important should come first, the default one should always come last. And delete public/index.html and you''ll be fine. -- One Guy With A Camera http://rbpark.ath.cx
Jonas Montonen wrote:> Deleted or renamed the public/index.html file have you? > Had that problem a couple of times now, when will I learn ;)Ah, yes, thank you. Is that documented anywhere? Thanks, James
James Britt wrote:> Jonas Montonen wrote: > >> Deleted or renamed the public/index.html file have you? >> Had that problem a couple of times now, when will I learn ;) > > > > Ah, yes, thank you. Is that documented anywhere? > > > Thanks, > > > James > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >It is actually... in the index.html file that you should delete, just before the default route example :)) "You''ll have to delete this file (public/index.html) to get under way. Then define a new route in config/routes.rb of the form" // JoNtE
Jonas Montonen wrote:> James Britt wrote: >> Ah, yes, thank you. Is that documented anywhere? >> > It is actually... in the index.html file that you should delete, just > before the default route example :)) > "You''ll have to delete this file (public/index.html) to get under way. > Then define a new route in config/routes.rb of the form"The page that starts, "Congratulations, you''ve put Ruby on Rails!"? Mine doesn''t say anything about that (or mention routes). I have installed Rails 0.10.1, though I created my app with 0.10.0, so this help text isn''t in my app. I also see that the option to alter the default action via WEBrick params has been removed in 0.10.1, too. Interesting. Thanks, James