Sha256: 3438e542d2bea5816e94bf760ae86495c61ae3f21300ccb76dbec1bd7240e608

Contents?: true

Size: 463 Bytes

Versions: 10

Compression:

Stored size: 463 Bytes

Contents

module Peek
  class ResultsController < ApplicationController
    before_filter :restrict_non_access
    respond_to :json

    def show
      if request.xhr?
        render :json => Peek.adapter.get(params[:request_id])
      else
        render :nothing => true, :status => :not_found
      end
    end

    private

    def restrict_non_access
      unless peek_enabled?
        raise ActionController::RoutingError.new('Not Found')
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
peek-0.1.9 app/controllers/peek/results_controller.rb
peek-0.1.8 app/controllers/peek/results_controller.rb
peek-0.1.7 app/controllers/peek/results_controller.rb
peek-0.1.6 app/controllers/peek/results_controller.rb
peek-0.1.5 app/controllers/peek/results_controller.rb
peek-0.1.4 app/controllers/peek/results_controller.rb
peek-0.1.3 app/controllers/peek/results_controller.rb
peek-0.1.2 app/controllers/peek/results_controller.rb
peek-0.1.1 app/controllers/peek/results_controller.rb
peek-0.1.0 app/controllers/peek/results_controller.rb