0
我將我的rails2路線文件,該文件的格式如下與動作路由錯誤而來自rails2轉換路線Rails3中
resources :levels ,:collection => {:search =>[:post,:get],:options => :get,:import_csv=>:get,:export=>:get,:upload_csv=>:post,:new=>:get,:edit=>:post,:options => :post}
到Rails3中休息格式
resources :levels do
collection do
post 'search'
get 'options'
get 'import_csv'
get 'export'
post 'upload_csv'
post 'options'
end
member do
end
end
,我定義這個在我的幫手文件,即
html << link_to('Import Csv',{:controller=>'levels',:action =>'import_csv'})
該文件不起作用,而是要'顯示'一個第二這是我收到的錯誤:
ActiveRecord::RecordNotFound in LevelsController#show
Couldn't find Level with ID=import_csv
app/controllers/levels_controller.rb:23:in `show'
Request Parameters: {"id"=>"import"}