Safari 6打破了Rails收集路线

时间:2012-11-02 17:22:07

标签: ruby-on-rails ruby-on-rails-3.2 safari

我在routes.rb文件中有以下代码:

resources :wbs_nos, except: [:new, :create] do
  collection { get 'wbs_tpr_filtered' }
end

resources :task_plan_requests do
  resources :wbs_nos, only: [:new, :create]

  collection do
    get :auto_complete_for_wbs_number_wbs_number
    get :auto_complete_for_task_plan_request_fabrication_work_order_number
    get :auto_complete_for_task_plan_request_requestor_building
    get :auto_complete_for_task_plan_request_requestor_name
    get :auto_complete_for_task_plan_request_requestor_email
  end
end

在Chrome中,当我转到localhost:3000 / wbs_nos / wbs_tpr_filtered时,请求被正确发送到WbsNosController中的was_tpr_filtered操作。

在Safari 6中,它将我发送到WbsNosController中的show动作,rails会给出错误:

  

找不到ID = wbs_tpr_filtered的WbsNo。

当我运行rake路线时,我得到了啰嗦:

wbs_tpr_filtered_wbs_nos GET /wbs_nos/wbs_tpr_filtered(.:format)  wbs_nos#wbs_tpr_filtered

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

当“无法找到ID = wbs_tpr_filtered的WbsNo”是有效错误时,没关系Safari缓存页面。删除文件夹Library / Caches / com.apple.Safari解决了这个问题。