为什么Rails 3.1为我的401页面呈现布局?

时间:2012-01-20 18:31:59

标签: ruby-on-rails-3

我的控制器未指定显式布局,因此它使用默认的应用程序布局。我的401错误页面有一个普通的html文件。它生活在公共场合。

此操作:

def index 
    render :file => "public/401.html", :status => :unauthorized, :layout => false
end

在布局中呈现401页面!它应该只是呈现页面,对吗?

1 个答案:

答案 0 :(得分:0)

是的,你是对的。它应该工作:

def index 
    render :file => "public/401.html", :status => :unauthorized, :layout => false 
end
相关问题