用! 在Ruby中

有人可以解释用法! 在以下ruby示例中:

 def show @article = Article.find(params[:id]) respond_to do |format| format.html { render :layout => ! request.xhr? } end end 

谢谢

not符合逻辑。

 request.xhr? => true !request.xhr? => false 

如果您不希望在请求来自AJAX时呈现布局。 然后使用:layout => !request.xhr?