Why destroy doesn't work

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 %> <%= link_to 'Show', district %> <%= link_to 'Edit', edit_district_path(district) %> <%= link_to 'Destroy', district, :confirm => 'Are you sure?', :method => :delete %> <% end %>

If I click on destroy link it shows me the district.

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

format.xml { head :ok }

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

If I click on destroy link it shows me the district.

Sorry I’ve missed javascript.

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