Class: Tramway::Api::V1::RecordsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tramway/api/v1/records_controller.rb

Instance Method Summary collapse

Methods included from AuthenticateHelper

#auth_params, #auth_token, #authenticate, #entity

Instance Method Details

#index ⇒ Object



3
4
5
6
7
8
9
# File 'app/controllers/tramway/api/v1/records_controller.rb', line 3

def index
  records = model_class.active.order(id: :desc).send params[:scope] || :all
  render json: records,
    meta: meta_pagination(records),
    each_serializer: serializer,
    status: :ok
end