나는 어리석은 짓을해야합니다. 이것이 작동하지 않는 이유에 대한 아이디어. 아래 설정으로 컨트롤러에 요청할 때 인증하라는 메시지가 나타납니다.before_filter : except는 작동하지 않는 것 같습니다.
class ApplicationController < ActionController::Base
before_filter :auth, :except => [:aboutus]
인증 방법은 다음과 같습니다. 그것은
#Simple HTTP Auth during development
def auth
authenticate_or_request_with_http_basic do |username, password|
username == "REDACTED" && password == "REDACTED"
end
end
감사
'aboutus '는 컨트롤러인가 액션인가? – Zabba
죄송합니다. aboutus가 앱 컨트롤러의 다른 컨트롤러가 아니라는 점을 분명히해야했습니다. Roadmaster는 내가 섞여 있었던 것을 발견했다. – Nick