trbrink
trbrink

Reputation: 137

Safari 6 breaking Rails collection routes

I have the following code in my routes.rb file:

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

In Chrome when I go to localhost:3000/wbs_nos/wbs_tpr_filtered the request is correctly sent to the was_tpr_filtered action in the WbsNosController.

In Safari 6 it is sending me to the show action in the WbsNosController and rails gives the error:

Couldn't find WbsNo with id=wbs_tpr_filtered.

I get the folling when I run rake routes:

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

Any ideas?

Upvotes: 1

Views: 77

Answers (1)

trbrink
trbrink

Reputation: 137

Never mind Safari cached the page when "Couldn't find WbsNo with id=wbs_tpr_filtered" was a valid error. Removing the folder Library/Caches/com.apple.Safari fixed the issue.

Upvotes: 2

Related Questions