必ず削除するかどうかを尋ねる確認メッセージが表示されますが、プレーヤーはそこに留まります。
これがコントローラーのdestroyメソッドです
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