redirect after destroy

This commit is contained in:
Andrew Coleman 2009-03-21 21:31:34 -05:00
commit 1a12aa9798

View file

@ -65,7 +65,11 @@ class Photos < Application
@photo = Photo.find_by_id(params[:id]) @photo = Photo.find_by_id(params[:id])
raise NotFound unless @photo raise NotFound unless @photo
if @photo.destroy if @photo.destroy
redirect url(:photos) if @photo.album
redirect url(:album, @photo.album)
else
redirect url(:photos)
end
else else
raise BadRequest raise BadRequest
end end