Class: Answers::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/answers/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#after_sign_in_path_for(resource_or_scope) ⇒ Object



22
23
24
25
# File 'app/controllers/answers/application_controller.rb', line 22

def (resource_or_scope)
  path = stored_location_for(resource_or_scope) || signed_in_root_path(resource_or_scope)
  "/#{path}" if path[0] != "/" # hackity hack
end

#redirect_to_back(default = root_url) ⇒ Object



14
15
16
17
18
19
20
# File 'app/controllers/answers/application_controller.rb', line 14

def redirect_to_back(default = root_url)
  if !request.env["HTTP_REFERER"].blank? and request.env["HTTP_REFERER"] != request.env["REQUEST_URI"]
    redirect_to :back
  else
    redirect_to default
  end
end