Forum: Ruby on Rails map.connect '' doesn't work

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.
Ce14206b729afc6ac1d4c454eb434af0?d=identicon&s=25 CiriusMex (Guest)
on 2009-04-09 17:36
(Received via mailing list)
Hi, got a problem with the map.connect '' in my website (I don't know
much of routes as I never really checked it).
Ok so I just want to redirect automaticaly the users to my index page
when they get to the site. So the idea is that using the address
"http://localhost:3000" using a route the user get to "http://
localhost:3000/dentistManager".

In my routes.rb I added:
map.connect '', :controller => 'dentistmanager', :action => "index"

So it looks like that:
ActionController::Routing::Routes.draw do |map|
  map.resources :consultations

  map.resources :patients

  map.resources :doctors

  map.resources :appointments

  map.connect '', :controller => 'dentistmanager', :action => "index"
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end

What am I doing wrong?
F85bacbbd4814799d4526b3e35a431df?d=identicon&s=25 Brandon Olivares (Guest)
on 2009-04-09 18:13
(Received via mailing list)
> Ok so I just want to redirect automaticaly the users to my index page
> when they get to the site. So the idea is that using the address
> "http://localhost:3000" using a route the user get to "http://
> localhost:3000/dentistManager".
>
> In my routes.rb I added:
> map.connect '', :controller => 'dentistmanager', :action => "index"

Change to:

map.root :controller => 'dentistmanager', :action => "index"

Brandon
Ce14206b729afc6ac1d4c454eb434af0?d=identicon&s=25 CiriusMex (Guest)
on 2009-04-09 18:39
(Received via mailing list)
Hmmm, doesn't work neither :(
Eecd295cdec2454c66e2015036a39408?d=identicon&s=25 Scott Nj (scottnj)
on 2009-04-09 18:47
(Received via mailing list)
what errors are you seeing? did you delete the index.html file in the
public folder?
Ce14206b729afc6ac1d4c454eb434af0?d=identicon&s=25 CiriusMex (Guest)
on 2009-04-09 18:51
(Received via mailing list)
Great, I deleted the index.html in the public folder and did the
trick! Didn't knew that one, thanks a lot to the both of you for the
help ^^
This topic is locked and can not be replied to.