Perche' non mi funziona il destroy?

class DistrictsController < ApplicationController
.
.
.
def destroy
@district = District.find(params[:id])
@district.destroy

respond_to do |format|
  format.html { redirect_to(districts_url) }
  format.xml  { head :ok }
end

end

<% @districts.each do |district| %>

<%= district.district_number %> <%= district.address %>
<td><%= link_to 'Show', district %></td>
<td><%= link_to 'Edit', edit_district_path(district) %></td>
<td><%= link_to 'Destroy', district, :confirm => 'Are you sure?',

:method => :delete %>

<% end %>

Cliccando sul link destroy mi viene mostrata la show.

On 16 February 2011 10:47, Mauro [email protected] wrote:

format.xml { head :ok }

<%= link_to 'Destroy', district, :confirm => 'Are you sure?', :method => :delete %> <% end %>

Cliccando sul link destroy mi viene mostrata la show.

Non avevo caricato il layout contenente il javascript, scusate.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs