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