Module: Jun::ActionController::Redirecting

Included in:
Base
Defined in:
lib/jun/action_controller/redirecting.rb

Instance Method Summary collapse

Instance Method Details

#redirect_to(location, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/jun/action_controller/redirecting.rb', line 6

def redirect_to(location, options = {})
  return if response_rendered?

  response.location = location
  response.status = options[:status] || 302
  response.write("<html><body>You are being <a href=\"#{response.location}\">redirected</a>.</body></html>")

  @_response_rendered = true
end