in app/controllers/microposts_controller.rb [16:25]
def destroy
@micropost.destroy
flash[:success] = "Micropost deleted"
if request.referrer.nil?
redirect_to root_url, status: :see_other
else
redirect_to request.referrer, status: :see_other
end
end