back/app/controllers/referrals_controller.rb
def show
    session[:referral_link] = request.original_url
    app = App.find_by(slug: params[:app_slug])
    referrer = User.find_by(referral_code: params[:referral_code])

    redirect_url = app.referral_landing_url

    # TODO what to do if referrer.nil? It essentially depends whether the app only allows "invited users" or allows public signup

    locals = {app: app, referrer: referrer, redirect_url: redirect_url, source_param: params[:source]}
    render template: 'referrals/show', locals: locals
  end
#
# Referral link interstitial page
# Loads a page including a tiny script that's in charge of creating the pending referral and saving it on the
# user's browser
#
Referral link interstitial page
Loads a page including a tiny script that's in charge of creating the pending referral and saving it on the
user's browser
Referral link interstitial page Loads a page including a tiny script that ' s in charge of creating the pending referral and saving it on the user ' s browser
def show
    session[:referral_link] = request.original_url
    app = App.find_by(slug: params[:app_slug])
    referrer = User.find_by(referral_code: params[:referral_code])
    redirect_url = app.referral_landing_url
    locals = {app: app, referrer: referrer, redirect_url: redirect_url, source_param: params[:source]}
    render template: 'referrals/show', locals: locals
  end
def show session [ :referral_link ] = request . original_url app = App . find_by ( slug : params [ :app_slug ] ) referrer = User . find_by ( referral_code : params [ :referral_code ] ) redirect_url = app . referral_landing_url locals = { app : app , referrer : referrer , redirect_url : redirect_url , source_param : params [ :source ] } render template : 'referrals/show' , locals : locals end
Referral link interstitial page
Loads a page including a tiny script that's in charge of creating the pending referral and saving it on the
user's browser
Referral link interstitial page Loads a page including a tiny script that ' s in charge of creating the pending referral and saving it on the user ' s browser
# TODO what to do if referrer.nil? It essentially depends whether the app only allows "invited users" or allows public signup