Question about controller inheritance


#1

Hi,

I’m trying to apply a theme from theme_support in my entire application.
Therefore it put a theme and layout line in the ApplicationController.
The way I understand it, every subclass from this controller will also
have the provided theme.

The beginning of the applicationcontroller looks like:

class ApplicationController < ActionController::Base
theme Siteconfig.instance.theme
layout ‘default’

 def index
 .....

Now, when I have a new controller containing

class PageController < ApplicationController
def index

I get the error:

Template is missing
Missing layout ./script/…/config/…/app/views/layouts/page.rhtml

When I do add the theme and layout to the pagecontroller as in:
class PageController < ApplicationController
theme Siteconfig.instance.theme
layout ‘default’

 def index
 ...

everything works correctly.

Why does the pagecontroller doesn’t inherit the theme and layout?