[email protected] wrote:
hi,
im pretty much a rails newbie, but i was wondering where the rhtml
files go for the application controller?
The application controller is basicly a controller for all controllers
(that’s what the top line says on most generated controllers:
class ExampleGeneratedController < ApplicationController
this is used for hierarcial ruby reasons to overwrite actions/methods in
“children” Controllers (instead of writing the same action for every
controller, it can be put in the application controller, and Each
subClass controller will have that method - it is very useful for
authentication systems… )
BUT … onto your issue - if you wish to see the homepage root rhtml, it
can be brought up in ANY controller - it’s all a matter of where you
route the root of the site to:
the myapp/config/routes.rb file handles this - all you have to do is
route ‘/’ to a controller and action, and the rhtml corresponding, will
be the rhtml of the root site. so, for example (supposing you have these
controllers and actions):
routes.rb
map.connect ‘/’, :controller => ‘posts’, :action => ‘list’
and then set up the rhtml in /app/view/posts/list to your liking. you
could do this with any controller and any action - there is no
limitation on this … you just have to set it up in the routes.rb
file…

hope this helps out…
-shai