public
Last active

redirect from inside of "destroy"

  • Download Gist
*scratch*.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
tasks_controller.rb:
 
def destroy
@task = Task.find(params[:id])
@task.destroy
redirect_to tasks_url
end
 
log:
 
Started DELETE "/tasks/4f85b2ddeaa951f8b0000006" for 127.0.0.1 at 2012-04-12 20:07:52 +0200
Processing by TasksController#destroy as JSON
Parameters: {"id"=>"4f85b2ddeaa951f8b0000006"}
 
Redirected to http://localhost:3000/tasks
Completed 302 Found in 34ms
 
Started DELETE "/tasks" for 127.0.0.1 at 2012-04-12 20:07:52 +0200
 
ActionController::RoutingError (No route matches [DELETE] "/tasks"):

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.