Forum: Ruby on Rails Inherited layout doesn't work

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Sam K. (Guest)
on 2007-08-01 04:47

I have a strange problem.

class ApplicationController < ActionController::Base
  layout 'test'

class UserController < ApplicationController


UserController's layout should be 'test'.
However, if app/view/layouts/user.rhtml exists, UserController uses it
as its layout.
If I remove user.rhtml, UserController uses 'test' as its layout.

So, it seems that UserController tries to use 'user' and only if it
doesn't exist, it uses the inherited layout.
Is this a feature or bug?

Thanks in advance.
This topic is locked and can not be replied to.