# Question about controller inheritance

**URL:** <https://www.ruby-forum.com/t/question-about-controller-inheritance/90518>\
**Category:** Rails\
**Created:** [March 29, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/question-about-controller-inheritance/90518 "2007-03-29T14:09:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brijnaald](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f14d63/32.png) [@brijnaald](https://www.ruby-forum.com/u/brijnaald)\
**Post date:** [March 29, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/question-about-controller-inheritance/90518/1 "2007-03-29T14:09:56Z")

</div>

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?
