Forum: Ruby on Rails site home 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.
matthew clark (Guest)
on 2005-12-15 06:01
(Received via mailing list)
Hi,

I have a really dumb qustion, but I can't find an answer in "Agile
Rails" or
any other hand holder.  And, it is a difficult topic to search for in
google.

What controller/view is used for the home page of a site?  I get how to
create new controllers, but I don't get at all how to change content on
the
home page.

thanks,
matt
Craig W. (Guest)
on 2005-12-15 06:04
(Received via mailing list)
On 15 Dec 2005, at 04:00, matthew clark wrote:
> What controller/view is used for the home page of a site?  I get
> how to create new controllers, but I don't get at all how to change
> content on the home page.

The one that you define in your config/routes.rb -- there's a few
comments in there which should give you a good idea about how to start.

Yours,
Craig
--
Craig W. | t: +44 (0)131 516 8595 | e: removed_email_address@domain.invalid
Xeriom.NET    | f: +44 (0)709 287 1902 | w: http://xeriom.net
Joe Van D. (Guest)
on 2005-12-15 06:34
(Received via mailing list)
On 12/14/05, Craig W. <removed_email_address@domain.invalid> wrote:
> On 15 Dec 2005, at 04:00, matthew clark wrote:
> > What controller/view is used for the home page of a site?  I get
> > how to create new controllers, but I don't get at all how to change
> > content on the home page.
>
> The one that you define in your config/routes.rb -- there's a few
> comments in there which should give you a good idea about how to start.

map.connect '', :controller => "default_controller", :action =>
"default_action"

That's what controller and action will be used when the user goes to
http://www.url.com/
Mark Dillon (Guest)
on 2005-12-15 06:37
(Received via mailing list)
The four days on rails tutorial has a good example of this.  Simply
add the following to your config/routes.rb file:

map.connect '', :controller => 'home'

Where 'home' is the name of the controller that should handle your
home page requests.  HTH...

Cheers,
Mark
This topic is locked and can not be replied to.