Sha256: 31605a0adf2f010ccfbe31d18fd6ff2ff7f777b207b6a1d3a90e407cf20baee2

Contents?: true

Size: 592 Bytes

Versions: 19

Compression:

Stored size: 592 Bytes

Contents

module Spina
  module Api
    class NavigationsController < ApiController
      include Paginable
      
      def index
        navigations = Navigation.order(:id)
        paginated = pagination(navigations)
        render json: Spina::Api::NavigationSerializer.new(paginated.first, paginated.last.merge(fields: {navigation: [:name, :label]})).serializable_hash.to_json
      end
      
      def show
        @navigation = Navigation.find(params[:id])
        render json: Spina::Api::NavigationSerializer.new(@navigation).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/navigations_controller.rb
spina-2.11.0 app/controllers/spina/api/navigations_controller.rb
spina-2.10.0 app/controllers/spina/api/navigations_controller.rb
spina-2.9.1 app/controllers/spina/api/navigations_controller.rb
spina-2.9.0 app/controllers/spina/api/navigations_controller.rb
spina-2.8.1 app/controllers/spina/api/navigations_controller.rb
spina-2.8.0 app/controllers/spina/api/navigations_controller.rb
spina-2.7.0 app/controllers/spina/api/navigations_controller.rb
spina-2.6.2 app/controllers/spina/api/navigations_controller.rb
spina-2.6.1 app/controllers/spina/api/navigations_controller.rb
spina-2.6.0 app/controllers/spina/api/navigations_controller.rb
spina-2.5.0 app/controllers/spina/api/navigations_controller.rb
spina-2.4.0 app/controllers/spina/api/navigations_controller.rb
spina-2.3.5 app/controllers/spina/api/navigations_controller.rb
spina-2.3.4 app/controllers/spina/api/navigations_controller.rb
spina-2.3.3 app/controllers/spina/api/navigations_controller.rb
spina-2.3.2 app/controllers/spina/api/navigations_controller.rb
spina-2.3.1 app/controllers/spina/api/navigations_controller.rb
spina-2.3.0 app/controllers/spina/api/navigations_controller.rb