zhangjingqiang 发表于 2012-02-13 13:46

二级分层的情况下delete方法为何失效?

比如程序创建的形式为:
admin/notice

控制层(notice_controller.rb)中是基本的scaffold写法;

视图中的写法为:<% @notices.each do |notice| %>
# something
<%= link_to 'Destroy', admin_notice_path(notice),confirm: 'Are you sure?', :method => :delete %>
<% end %>routes.rb中的写法为:scope 'admin', :as => 'admin', :module => 'admin' do
# something
resources :notice
end在程序执行时,点击“Destroy”链接导向了show方法,其中的“:method => :delete”为什么没起作用?
页: [1]
查看完整版本: 二级分层的情况下delete方法为何失效?