使用rails-ckeditor并且每当我尝试使用“浏览服务器”然后“上传”按钮上传图像时,我都会收到 401 异常。我现在正在使用简单的基本身份验证来保护我的网站
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :authenticate
def logged_in?
# cookies[:auth].present?
end
def authenticate
# unless logged_in?
authenticate_or_request_with_http_basic do |login, password|
if(login == "user1" && password == "password")
cookies.permanent.signed[:auth] = login
end
end
# end
end
def current_church
@current_church ||= Church.first
end
end
如果我禁用基本身份验证,一切正常。有没有办法解决这个问题?
谢谢-wg