link_to delete redirecting to show action instead of going to destroy action in rails 3.1.1
Here is my code
View:-
:delete, :confirm => "Are you sure..!", :alt => "Delete", :title => "Delete" %>
Controller:-
def destroy @industry = Industry.find(params[:id]) if @industry.destroy flash[:notice] = "Successfully deleted industry with name #{@industry.name}" else flash[:error] = "Error Occurred while deleting industry. Please try again." end redirect_to industries_path
end
$ CONTROLLER=controller_name rake routes
to list routing. – Shamith c