layout inheritance

According to "Ruby On Rails", the layout call is suppose to be inherited: (page 508)

"Subclasses of a controller will use the parent's layout unless they override it using the layout directive"

I have a case where this is not working. I have not spent time to concoct a stand alone test. I wanted to verify that David's book is correct first.

Can someone voice an opinion if it should or should not be inherited by subclasses of the controller?

Thanks, Perry

It should be inherited. I use this in several of my projects and it has always worked for me.

According to "Ruby On Rails", the layout call is suppose to be inherited: (page 508)

Hi Perry,

Please direct usage questions to the rubyonrails-talk list. This list is exclusively for talking about the development of Rails itself. I'm sure someone can help you on the other list.

Sorry for the noise but I felt like I wasn't asking a usage question.

To me it sounded like a bug report. Pedz, you should really try and make a failing test against existing tests in the framework. That will end the guessing game and give us something to work with.

layouts don't really behave well with inheritance.

http://dev.rubyonrails.org/search?q=layout+inherit&wiki=on&changeset=on&ticket=on

I wondered off and created a test case only to discover that it is not a bug and now I understand better.

Plus, now I understand how to create a test case.

Part of this was a usage question after all and I also have learned how to use ri more effective. The output of "ri layout" is quit small. But "ri ActionController::Layout::ClassMethods" is where all the good stuff is at.