Forum: Ruby on Rails routing to the welcome page

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.
775b1c27ba2dcbd4c26438b8a557f0a2?d=identicon&s=25 Bahadır Doğan (xyzt)
on 2007-07-22 09:05
Hello

I want to setup the welcome page as the default page. so, i added the
last line belove to my config/routes.rb file but nothing changes.



ActionController::Routing::Routes.draw do |map|

  map.connect ':controller/:action/:id.:format'
  map.connect ':controller/:action/:id'
  map.connect '', :controller=>'main', :action=>'welcome'
end



it still do not open the main/welcome when i type
"http://localhost:3000/". what's the problem?

Thanks.
4c3acdc3d93f54cc7a7281780ec8a4ee?d=identicon&s=25 Shai Rosenfeld (shai)
on 2007-07-22 09:27
Bahadır Doğan wrote:
> Hello
>
> I want to setup the welcome page as the default page. so, i added the
> last line belove to my config/routes.rb file but nothing changes.
>
>
>
> ActionController::Routing::Routes.draw do |map|
>
>   map.connect ':controller/:action/:id.:format'
>   map.connect ':controller/:action/:id'
>   map.connect '', :controller=>'main', :action=>'welcome'
> end
>
>
>
> it still do not open the main/welcome when i type
> "http://localhost:3000/". what's the problem?
>
> Thanks.

two things:

a) put
   map.connect '', :controller=>'main', :action=>'welcome'
on the top line

b) remove the index.html file that is in pubic .. it may be overriding
the route defined. (via the server which redirects there ; lighttpd /
ngnix / what-ever-server )
775b1c27ba2dcbd4c26438b8a557f0a2?d=identicon&s=25 Bahadır Doğan (xyzt)
on 2007-07-22 23:23
thank you.that solved the problem.
This topic is locked and can not be replied to.