Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

redirect

  • Loading branch information...
commit 22945ab100458e866115f84f1ea4ba413d8aeb45 1 parent 89acb2f
blake.mizerany@gmail.com authored
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])
Please sign in to comment.
Something went wrong with that request. Please try again.