mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
redirect
This commit is contained in:
parent
89acb2fcdc
commit
22945ab100
1 changed files with 6 additions and 0 deletions
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue