Skip to content

Instantly share code, notes, and snippets.

@mytrile
Created January 7, 2009 23:31
Show Gist options
  • Select an option

  • Save mytrile/44500 to your computer and use it in GitHub Desktop.

Select an option

Save mytrile/44500 to your computer and use it in GitHub Desktop.
def destroy
if Category.destroy(params[:id])
flash[:notice] = 'Category successfully deleted !'
redirect_to :action => "index"
else
flash[:error] = 'There was an error processing your request'
redirect_to :action => "index"
end
end
<%= link_to "Delete category", :action => "destroy", :id => @category.id %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment