직접 질문 ActionController
는 컨트롤러 클래스없는 대답하기 위해, 그 힘 전체 컨트롤러 스택을 네임 스페이스 지정 모듈입니다. 일반적인 Rails 개발 중에는 ActionController
모듈과 상호 작용하지 않습니다. ActionController::Base
은 실제로 컨트롤러가 상속하는 클래스입니다. 따라서 ActionController
에서 상속받을 수 없습니다.
하지만 여기에는 두 개의 컨트롤러가 있다고 생각합니다. ActionController::Base
및 ApplicationController
. 제 생각에 이 ::Base
이 아닌 ActionController
인 것으로 잘못 생각하는 것 같습니다.
ActionController::Base
는 레일의 모든 기능에서 오는 메인 컨트롤러 클래스입니다. ApplicationController
는 당신이 방법을 추가하고 다른 레일 컨트롤러의 모든 상속 할 수 있습니다 일반화 된 컨트롤러입니다.
당신은 당신의 컨트롤러 중 하나에서 다른 레이아웃을 사용하여 다음을 수행 할 수 :
class AuthenticationController < ApplicationController
layout 'authentication'
end
당신은 직접 AuthenticationController
를 사용하거나 새로운 컨트롤러가 AuthenticationController
에서 상속 할 수 있습니다.