Sha256: 2277822bda0d8852da23673ed5717de87f99b4751777445c273fefe64fbc4edb

Contents?: true

Size: 935 Bytes

Versions: 4

Compression:

Stored size: 935 Bytes

Contents

module FlyAdmin
  class SubscriptionsController < ActionController::Base
    def start
      get_cookie
      if @customer_key.present?
        # video can be in multiple categories , so save category_id
        session[:video] = JSON.generate({ :id => params[:video_id], :category_id => params[:category_id], :season_id => params[:season_id] })
        link =  "http://#{@alias}/continue?key=#{@customer_key}"
        redirect_to link
      else
        render nothing: true
      end
    end
    
    def splash  
      begin
        link = params[:back_url] + "?key=#{params[:customer_key]}"
        redirect_to link
      rescue Exception => e 
        SUBSCRIPTION_LOG.error "#{e.message}\n\t#{e.backtrace}"
        render nothing: true
      end  
    end

    private

    def get_cookie
      if session[:alias]
        @alias = session[:alias] 
        @customer_key = session[:customer_key]
      end
    end  
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fly_admin-0.0.5 app/controllers/fly_admin/subscriptions_controller.rb
fly_admin-0.0.4 app/controllers/fly_admin/subscriptions_controller.rb
fly_admin-0.0.3 app/controllers/fly_admin/subscriptions_controller.rb
fly_admin-0.0.2 app/controllers/fly_admin/subscriptions_controller.rb