Module: Goat::AppHelpers

Included in:
App
Defined in:
lib/goat.rb

Instance Method Summary collapse

Instance Method Details

#halt(body = nil) ⇒ Object

Raises:



482
483
484
485
# File 'lib/goat.rb', line 482

def halt(body=nil)
  response.body = body if body
  raise Halt.new(response)
end

#redirect(url) ⇒ Object



487
488
489
490
491
# File 'lib/goat.rb', line 487

def redirect(url)
  response.status = 302
  response['Location'] = url
  halt
end

#sessionObject



493
494
495
# File 'lib/goat.rb', line 493

def session
  request.env['rack.session'] ||= {}
end