,我有以下毁在我的曲目控制器的方法:路由错误 - 无路由匹配[POST]
我可以用毁灭一个发行途径:
<%= link_to 'Destroy', release_track_path(@release,track), :confirm => 'Are you sure?', :method => :delete %>
但我得到一个路由错误“无路由匹配[POST]‘/产品/ 74 /音轨/ 43’,”当我试图破坏产品导轨:
<%= link_to 'Destroy', product_track_path(@product,track), :confirm => 'Are you sure?', :method => :destroy %>
我已经采取了看看我的路线文件,并认为这可能是一个问题,但尝试了几件事,我很难过!谁能帮忙?这真让我抓狂。如果使用我的创建方法中的els,则使用相同的方法,并且它对Release Track和Product Track都可以正常工作。
这里是我的routes.rb(我怀疑这是一个很大的混乱!)
Dashboard::Application.routes.draw do
get "home/index"
root :to => "home#index"
get "tracks/new"
get "tracks/create"
get "tracks/update"
get "tracks/edit"
get "tracks/destroy"
get "tracks/show"
get "tracks/index"
get "help/index"
resources :helps
resources :roles
resources :labels
devise_for :users
resources :users
resources :releases do
resources :artists
resources :tracks
resources :products do
resources :tracks
resources :itunes_data
end
end
resources :itunes_data
resources :tracks do
collection { post :sort }
end
resources :products do
resources :tracks
collection do
get 'schedulecsv'
get 'schedule'
get 'new_releases'
get 'active_lines'
get 'deleted_lines'
get 'gemsetup'
get 'amazonsetup'
get 'search'
end
end
resources :artists
end
它看起来像你在你的Release方法中使用':method =>:delete',但在Track上使用':method =>:destroy'。这是你的调试工件吗? – ScottJShea 2012-03-16 15:43:03
哈!现在我感到很蠢!猜猜它只是需要另一双眼睛有时候吧!很多appreicated,谢谢! – Raoot 2012-03-16 15:48:37
没问题...我一直这么做......我做的另一件事是调试一段时间尝试一些事情,然后发布调试尝试使事情更令人困惑 – ScottJShea 2012-03-16 15:49:29