wejrowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jun-10 15:35 UTC
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?..
wejrowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 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 marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
wejrowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jun-10 17:10 UTC
Re: The main index.html
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..
wejrowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jun-10 17:14 UTC
Re: The main index.html
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.
wejrowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 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" ... On Jun 10, 10:52 am, Phlip <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> wejrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 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