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.
Bahadır D. (Guest)
on 2007-07-22 11: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.
Shai R. (Guest)
on 2007-07-22 11: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 )
Bahadır D. (Guest)
on 2007-07-23 01:23
thank you.that solved the problem.
This topic is locked and can not be replied to.