【发布时间】:2012-03-16 09:30:27
【问题描述】:
我在 rails 3.0 应用程序中使用 jquery mobile。尝试从用户列表中删除项目时出现路由错误。代码和错误信息如下。
index.mobile.erb:
<% @items.each do |i| %>
...
<div data-role="button">
<%= link_to 'Delete', i, :confirm => 'Are you sure?', :method => :delete %>
</div>
<% end %>
路由文件:
resources :items, :except => [:show]
耙路线:
DELETE /items/:id(.:format) {:action=>"destroy", :controller=>"items"}
错误信息:
Started GET "/items/2" for 127.0.0.1 at 2012-02-26 13:31:37 -0500
ActionController::RoutingError (No route matches "/items/2"):
我错过了什么?
谢谢!
更新 - 萤火虫: @http://localhost:3000/javascripts/jquery-1.6.1.js?1310343332:641 @http://localhost:3000/javascripts/jquery.mobile-1.0.1.js?1329380575:2737 @http:// /localhost:3000/javascripts/jquery.mobile-1.0.1.js?1329380575:3030 @http://localhost:3000/javascripts/jquery.mobile-1.0.1.js?1329380575:3393 @http://localhost :3000/javascripts/jquery-1.6.1.js?1310343332:2926 @http://localhost:3000/javascripts/jquery-1.6.1.js?1310343332:2560 jquery...0343332(第 641 行) "NetworkError: 404 Not Found - http://localhost:3000/items/2"
【问题讨论】:
标签: ruby-on-rails-3 jquery-mobile