Forum: Ruby on Rails Inherited layout doesn't work

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

I have a strange problem.

class ApplicationController < ActionController::Base
  layout 'test'
end

class UserController < ApplicationController

end

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.
Sam
This topic is locked and can not be replied to.