Sha256: 350bbb7a0f8d70667b1c3d28341caed233d1d4c2c9d5783be74b429dda05598e

Contents?: true

Size: 521 Bytes

Versions: 6

Compression:

Stored size: 521 Bytes

Contents

module Tally
  class RecordsController < Tally::ApplicationController

    def index
      records = search.records.page(params[:page]).per(params[:per_page] || 24).without_count

      render json: {
        records: records.map { |record|
          RecordPresenter.new(record).to_hash
        },
        meta: {
          next_page: records.next_page,
          current_page: records.current_page,
          previous_page: records.prev_page,
          per_page: records.limit_value
        }
      }
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tally-2.1.0 app/controllers/tally/records_controller.rb
tally-2.0.0 app/controllers/tally/records_controller.rb
tally-1.0.2 app/controllers/tally/records_controller.rb
tally-1.0.1 app/controllers/tally/records_controller.rb
tally-1.0.0 app/controllers/tally/records_controller.rb
tally-1.0.0.beta1 app/controllers/tally/records_controller.rb