Sha256: 150f05f81b11aed227383cfb756431215d33584cded137b2c689f38684870303

Contents?: true

Size: 297 Bytes

Versions: 2

Compression:

Stored size: 297 Bytes

Contents

class ReferralsController < ApplicationController

  def create
    unless user_signed_in?
      @referral = Referral.from_token(params[:referrer_token])      
      session[:referral_token] = @referral.referral_token if @referral
    end
    redirect_to "/#{params[:path].join('/')}"
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise_referable-0.2.0 app/controllers/referrals_controller.rb
devise_referable-0.1.0 app/controllers/referrals_controller.rb