Skip to content
Snippets Groups Projects
Commit 0187a45d authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

Merge branch 'learning_objects-paginator' into 'master'

Learning objects paginator



See merge request !250
parents d9e7d768 d76296f9
No related branches found
No related tags found
No related merge requests found
......@@ -137,7 +137,7 @@ gem 'screencap'
# using while rails 5 isn't released
gem 'rails-api'
gem 'active_model_serializers', '<=0.9'
gem 'active_model_serializers'
# limit the number of requests by user to api
gem 'redis-throttle', git: 'git://github.com/lelylan/redis-throttle.git'
......
......@@ -6,11 +6,11 @@ class V1::LearningObjectsController < ApplicationController
include ::Paginator
before_action :authenticate_user!, except: [:index, :show]
before_action :set_learning_object, only: [:show, :create, :update, :destroy]
before_action :set_learning_object, only: [:show, :update, :destroy]
before_action :authorize!
def index
render json: LearningObject.limit(limit).offset(offset).all
render json: ActiveModel::ArraySerializer.new(LearningObject.limit(limit).offset(offset).all)
end
# GET /learning_objects/1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment