Sha256: 30738fcc8029eba32d0a4e473720ede7d28c8eba863890c45e215b1a531aedbd

Contents?: true

Size: 478 Bytes

Versions: 19

Compression:

Stored size: 478 Bytes

Contents

module Spina
  module Api
    class ResourcesController < ApiController
      include Paginable
      
      def index
        resources = Resource.order(:id)
        render json: Spina::Api::ResourceSerializer.new(*pagination(resources)).serializable_hash.to_json
      end
      
      def show
        @resource = Resource.find(params[:id])
        render json: Spina::Api::ResourceSerializer.new(@resource).serializable_hash.to_json
      end
      
    end
  end
end
      

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
spina-2.12.0 app/controllers/spina/api/resources_controller.rb
spina-2.11.0 app/controllers/spina/api/resources_controller.rb
spina-2.10.0 app/controllers/spina/api/resources_controller.rb
spina-2.9.1 app/controllers/spina/api/resources_controller.rb
spina-2.9.0 app/controllers/spina/api/resources_controller.rb
spina-2.8.1 app/controllers/spina/api/resources_controller.rb
spina-2.8.0 app/controllers/spina/api/resources_controller.rb
spina-2.7.0 app/controllers/spina/api/resources_controller.rb
spina-2.6.2 app/controllers/spina/api/resources_controller.rb
spina-2.6.1 app/controllers/spina/api/resources_controller.rb
spina-2.6.0 app/controllers/spina/api/resources_controller.rb
spina-2.5.0 app/controllers/spina/api/resources_controller.rb
spina-2.4.0 app/controllers/spina/api/resources_controller.rb
spina-2.3.5 app/controllers/spina/api/resources_controller.rb
spina-2.3.4 app/controllers/spina/api/resources_controller.rb
spina-2.3.3 app/controllers/spina/api/resources_controller.rb
spina-2.3.2 app/controllers/spina/api/resources_controller.rb
spina-2.3.1 app/controllers/spina/api/resources_controller.rb
spina-2.3.0 app/controllers/spina/api/resources_controller.rb