Browse files

redirect

  • Loading branch information...
1 parent 89acb2f commit 22945ab100458e866115f84f1ea4ba413d8aeb45 blake.mizerany@gmail.com committed Sep 25, 2007
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/sinatra/event.rb
View
6 lib/sinatra/event.rb
@@ -99,6 +99,12 @@ def views_dir(value = nil)
@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])

0 comments on commit 22945ab

Please sign in to comment.