Reputation: 31
Routes
resources :listings do
member do
post :leadcreate
post :storycreate
end
end
Controller Action
def destroy
@listing = Listing.find(params[:id])
@listing.destroy
redirect_to 'root_path', :notice => "Listing Successfully Deleted"
end
View
<%= link_to "Delete", listing_path(@listing), :confirm => "Confirm Deletion", :method => :delete %>
Error
It just goes to "No Data Received" page and then when I refresh and go back to root the listing has actually been deleted.
Upvotes: 0
Views: 33