Module: Boomerang::ControllerSupport

Defined in:
lib/boomerang/controller_support.rb

Instance Method Summary collapse

Instance Method Details

#redirect_away(*args) ⇒ Object



2
3
4
5
# File 'lib/boomerang/controller_support.rb', line 2

def redirect_away(*args)
  session[:boomerang_return_path] = request.fullpath
  redirect_to *args
end

#redirect_back(*args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/boomerang/controller_support.rb', line 7

def redirect_back(*args)
  if return_uri = session[:boomerang_return_path]
    redirect_to return_uri
    session[:boomerang_return_path] = nil
  elsif args.empty?
    redirect_to '/'
  else
    redirect_to *args
  end
end