0
나는이 게시물 다음입니다 :내 application.rb 파일에서 활성 관리자의 current_user를 인식하도록하려면 어떻게합니까?
Active Admin - Same model for users and admins
을 나는 내 애플 리케이션/컨트롤러에서/application_controller.rb 내가 놓치고 생각하지만
뭔가를
# if user is not admin redirect to main page
def admin_required
current_user.is_admin? || redirect_to("/")
end
를 뒀다 like
require 'activeadmin'
undefined local variable or method `current_user'
내가 단계 또는 뭔가를 놓친 적이 :또는 뭔가 나는 다음과 같은 오류가 발생하고 있기 때문에?
를? 외부 라이브러리를 사용하지 않는 경우에는 current_user에 대한 고유 한 메소드를 작성해야합니다. 메서드는 쿠키/세션 자격 증명을 기반으로 현재 사용자를 식별하고 해당 사용자에 대한 모델 객체 만들기를 호출합니다. – djd