From 22945ab100458e866115f84f1ea4ba413d8aeb45 Mon Sep 17 00:00:00 2001 From: "blake.mizerany@gmail.com" Date: Tue, 25 Sep 2007 17:42:21 +0000 Subject: [PATCH] redirect --- lib/sinatra/event.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/sinatra/event.rb b/lib/sinatra/event.rb index deff9356..8cd31b28 100644 --- a/lib/sinatra/event.rb +++ b/lib/sinatra/event.rb @@ -99,6 +99,12 @@ module Sinatra @views_dir || File.dirname($0) + '/views' end + def redirect(path) + logger.info "Redirecting to: #{path}" + status 302 + header 'Location' => path + end + def determine_template(content, ext) if content.is_a?(Symbol) File.read("%s/%s.%s" % [views_dir, content, ext])