Skip to content
Snippets Groups Projects
Commit da86fb51 authored by Douglas AC's avatar Douglas AC
Browse files

Paginating index method response in questions.

parent 64702510
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@
# along with portalmec. If not, see <http://www.gnu.org/licenses/>.
class V1::QuestionsController < ApplicationController
include ::Paginator
before_action :authenticate_user!, except: [:destroy, :index]
before_action :set_question, only: [:show, :update, :destroy]
......@@ -24,7 +25,7 @@ class V1::QuestionsController < ApplicationController
# GET /questions
def index
@questions = Question.all
@questions = paginate Question.all
render json: @questions
end
......
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