app/controllers/application_controller.rb
def redirect_back_or_default(default = root_path)
    back = session[:return_to]
    session.delete(:return_to)
    if back
      Rails.logger.debug "Returning to #{back}"
      session[:return_to] = "redirected"
      redirect_to(back) and return
    else
      Rails.logger.debug "Returning to default (#{default})"
      redirect_to(default) and return
    end
  end
# Redirect to the URI stored by the most recent store_location call or
# to the passed default.
Redirect to the URI stored by the most recent store_location call or
to the passed default.
Redirect to the URI stored by the most recent store_location call or to the passed default .
def redirect_back_or_default(default = root_path)
    back = session[:return_to]
    session.delete(:return_to)
    if back
      Rails.logger.debug "Returning to #{back}"
      session[:return_to] = "redirected"
      redirect_to(back) and return
    else
      Rails.logger.debug "Returning to default (#{default})"
      redirect_to(default) and return
    end
  end
def redirect_back_or_default ( default = root_path ) back = session [ :return_to ] session . delete ( :return_to ) if back Rails . logger . debug "Returning to #{back}" session [ :return_to ] = "redirected" redirect_to ( back ) and return else Rails . logger . debug "Returning to default (#{default})" redirect_to ( default ) and return end end
Redirect to the URI stored by the most recent store_location call or
to the passed default.
Redirect to the URI stored by the most recent store_location call or to the passed default .
default
root_path