【发布时间】:2012-12-30 17:27:32
【问题描述】:
我试图弄清楚 spree_easy 联系人 gem 中的 admin/topics 控制器中发生了什么。控制器中有这段代码:
new_action.response do |wants|
wants.html {render :action => :new, :layout => !request.xhr?}
end
我想看看request.xhr? 解析到什么。我如何使用 pry 调试来访问它?
【问题讨论】:
-
将 binding.pry 放在 do 块的末尾有什么问题? ...!request.xhr?} binding.pry end
-
.xhr?检查是否存在header[X-Requested-With]
标签: ruby-on-rails ruby debugging pry