The main index.html

So if I want to grab info from various Models and put it on the main
Index page how does that work? Since there’s no main index view or
controller?.. or is there?..

[email protected] wrote:

So if I want to grab info from various Models and put it on the main
Index page how does that work? Since there’s no main index view or
controller?.. or is there?..

There can be. You can map the root path to anything you want – check
the routing docs.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Anyone know off hand what that would be to connect a controller and
view to the main index.html?

been looking around, seems this should do it?

map.connect “/”, :controller => ‘the5one’, :action => “index”

Tried a few combinations of that… can’t get it going… I’ll fiddle
around a bit more…

[email protected] wrote:

So if I want to grab info from various Models and put it on the main
Index page how does that work? Since there’s no main index view or
controller?.. or is there?..

Rails’s default index.html file tells you what to do there.


Phlip

Not to beat a dead horse, but your routes.rb file is pretty clear on
this.

You can have the root of your site routed with map.root – just

remember to delete public/index.html.

map.root :controller => “welcome”

Got it!

Either of these work:

map.connect “”, :controller => ‘mycontroller’, :action => “index”

map.root :controller => “mycontroller”

I just had to delete the index.html in the public directory.