我有一個項目下面的列表:軌,破壞鏈接NoMethodError
= @kid.educations.each do |education|
= education.studies_centre
= _('-')
= education.city_and_country
= link_to _("<i class='fa fa-times-circle a-lg'></i> delete").html_safe, education, :confirm => 'Are you sure?',:method => :delete, class: "btn btn-danger btn-xs pull-right"
%br
%small
= education.academic_qualification
%hr
%br
正如你所看到的,我有一個刪除選項,但我不工作。我得到:
undefined method `education_path' for #<#<Class:0x007fd00c61c270>:0x007fd00cdd5b88>
我做錯了什麼。
感謝您的幫助
更新路由
dashboard_kid_educations GET /dashboard/kids/:kid_id/educations(.:format) dashboard/educations#index
POST /dashboard/kids/:kid_id/educations(.:format) dashboard/educations#create
new_dashboard_kid_education GET /dashboard/kids/:kid_id/educations/new(.:format) dashboard/educations#new
edit_dashboard_kid_education GET /dashboard/kids/:kid_id/educations/:id/edit(.:format) dashboard/educations#edit
dashboard_kid_education GET /dashboard/kids/:kid_id/educations/:id(.:format) dashboard/educations#show
PUT /dashboard/kids/:kid_id/educations/:id(.:format) dashboard/educations#update
DELETE /dashboard/kids/:kid_id/educations/:id(.:format) dashboard/educations#destroy
顯示您的'routes.rb'或輸出'rake routes'。 –
準備就緒的路線。 – Jean