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| %>
<tr>
<td><%= district.district_number %></td>
<td><%= district.address %></td>
<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 %></td>
</tr>
<% end %>
If I click on destroy link it shows me the district.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.