Sha256: 9d5dbd62ac369e784ccafa8ec61e12e92e06439ef7d4cdc35fc9a4c872413fbd

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

module AssetHostCore
  module Api
    class OutputsController < BaseController
      before_filter -> { authorize(:read) }, only: [:index, :show]
      before_filter :get_output, only: [:show]


      def index
        @outputs = Output.all
        respond_with @outputs
      end

      def show
        respond_with @output
      end


      private

      def authorize(ability)
        super ability, "AssetHostCore::Output"
      end

      def get_output
        @output = Output.find_by_code(params[:id])

        if !@output
          render_not_found and return false
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asset_host_core-2.0.0.beta app/controllers/asset_host_core/api/outputs_controller.rb