added pagination for all resources
This commit is contained in:
@@ -27,7 +27,7 @@ class ConsumersController < ApplicationController
|
||||
private :consumer_params
|
||||
|
||||
def index
|
||||
@consumers = Consumer.all
|
||||
@consumers = Consumer.paginate(page: params[:page])
|
||||
authorize!
|
||||
end
|
||||
|
||||
|
@@ -27,7 +27,7 @@ class ErrorsController < ApplicationController
|
||||
private :error_params
|
||||
|
||||
def index
|
||||
@errors = Error.for_execution_environment(@execution_environment).grouped_by_message
|
||||
@errors = Error.for_execution_environment(@execution_environment).grouped_by_message.paginate(page: params[:page])
|
||||
authorize!
|
||||
end
|
||||
|
||||
|
@@ -34,7 +34,7 @@ class ExecutionEnvironmentsController < ApplicationController
|
||||
private :execution_environment_params
|
||||
|
||||
def index
|
||||
@execution_environments = ExecutionEnvironment.all.includes(:user).order(:name)
|
||||
@execution_environments = ExecutionEnvironment.all.includes(:user).order(:name).paginate(page: params[:page])
|
||||
authorize!
|
||||
end
|
||||
|
||||
|
@@ -78,7 +78,7 @@ class ExercisesController < ApplicationController
|
||||
|
||||
def index
|
||||
@search = policy_scope(Exercise).search(params[:q])
|
||||
@exercises = @search.result.includes(:execution_environment, :user).order(:title)
|
||||
@exercises = @search.result.includes(:execution_environment, :user).order(:title).paginate(page: params[:page])
|
||||
authorize!
|
||||
end
|
||||
|
||||
|
@@ -5,7 +5,7 @@ class ExternalUsersController < ApplicationController
|
||||
private :authorize!
|
||||
|
||||
def index
|
||||
@users = ExternalUser.all.includes(:consumer)
|
||||
@users = ExternalUser.all.includes(:consumer).paginate(page: params[:page])
|
||||
authorize!
|
||||
end
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class FileTypesController < ApplicationController
|
||||
private :file_type_params
|
||||
|
||||
def index
|
||||
@file_types = FileType.all.includes(:user).order(:name)
|
||||
@file_types = FileType.all.includes(:user).order(:name).paginate(page: params[:page])
|
||||
authorize!
|
||||
end
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class HintsController < ApplicationController
|
||||
private :hint_params
|
||||
|
||||
def index
|
||||
@hints = @execution_environment.hints.order(:name)
|
||||
@hints = @execution_environment.hints.order(:name).paginate(page: params[:page])
|
||||
authorize!
|
||||
end
|
||||
|
||||
|
@@ -62,7 +62,7 @@ class InternalUsersController < ApplicationController
|
||||
|
||||
def index
|
||||
@search = InternalUser.search(params[:q])
|
||||
@users = @search.result.includes(:consumer).order(:name)
|
||||
@users = @search.result.includes(:consumer).order(:name).paginate(page: params[:page])
|
||||
authorize!
|
||||
end
|
||||
|
||||
|
@@ -22,7 +22,7 @@ class TeamsController < ApplicationController
|
||||
end
|
||||
|
||||
def index
|
||||
@teams = Team.all.includes(:internal_users).order(:name)
|
||||
@teams = Team.all.includes(:internal_users).order(:name).paginate(page: params[:page])
|
||||
authorize!
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user