出现一条确认消息,询问您是否确定要删除,但随后播放器停留在那里。
这是我在控制器中的销毁方法
def destroy
Player.find(params[:id]).destroy
redirect_to :action => 'index'
end
这是我的删除链接
<ul>
<% @players.each do |p| %>
<li>
<%= link_to p.name, {:action => 'show', :id => p.id} -%> email:<%= p.email %>
<%= link_to 'edit', {:action => "edit",
:id => p.id} %>
<%= link_to "Delete", {:action => 'destroy' ,:id => p.id}, :confirm => "Are you sure you want to delete this item?" %></li>
<% end %>
</ul>
<p><%= link_to "Add new player", {:action => 'new' }%></p>
这是日志
Started GET "/players" for 127.0.0.1 at 2013-03-25 15:30:55 +0200
Processing by PlayersController#index as HTML
Player Load (0.1ms) SELECT "players".* FROM "players"
Rendered players/index.html.erb within layouts/application (1.0ms)
Completed 200 OK in 46ms (Views: 45.3ms | ActiveRecord: 0.1ms)
[2013-03-25 15:30:55] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true