1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00
This commit is contained in:
blake.mizerany@gmail.com 2007-09-25 17:42:21 +00:00
parent 89acb2fcdc
commit 22945ab100

View file

@ -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])