hey there,
i am a brand new rails guy. I am using rad rails because i already use
eclipse for all things python and php.
my question is, when you start a new project, how do you get the index
page in the web folder to point to different controllers ? What i mean
is, in all the tutorials, you see them point browsers to
localhost:3000/say/hello, or localhost:3000/user/login. But if i point
an app to localhost:3000/ should i just redirect_to to wherever i want
the index page to be?
i know this is the most basic of questions. I am still trying to get my
head around MVC. I know it will be worth it in the end, but now…
thanks
check out config/routes.rb
You can have the root of your site routed by hooking up ‘’
– just remember to delete public/index.html.
map.connect ‘’, :controller => “welcome”
edit config/routes.rb and add:
map.connect ‘’, :controller => “whatever”
before the line map.connect ‘:controller/:action/:id’
where “whatever” is simply the controller that you wish to handle the
request for localhost:3000/
If you want to specify a default method (instead of “index”) then
just add this to the end of the line:
map.connect ‘’, :controller => “whatever”, :action => “however”.
~Wayne
On Nov 8, 9:17 pm, “Wayne E. Seguin” [email protected] wrote:
just add this to the end of the line:
eclipse for all things python and php.
get my
head around MVC. I know it will be worth it in the end, but now…
thanks
well ok, thanks guys !
-shawn