Skip to content

Instantly share code, notes, and snippets.

@neaf
Created December 25, 2009 20:03
Show Gist options
  • Select an option

  • Save neaf/263737 to your computer and use it in GitHub Desktop.

Select an option

Save neaf/263737 to your computer and use it in GitHub Desktop.
# GET/DELETE /projects/:id/quotes/:quote_id/delete
def destroy
@project = Project.find(params[:id])
raise Rango::NotFound unless @project
@quote = Quote.first(:id => params[:id], :id => params[:quote_id])
raise Rango::NotFound unless @quote
if request.delete?
@quote.destroy
flash.notice = "Quote has been successfully deleted."
redirect url(:quotes, :id => @project.id)
else
render "quotes/confirm_delete.html"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment