Class: Elabs::UsersController

Inherits:
ElabsPublicController show all
Defined in:
app/controllers/elabs/users_controller.rb

Constant Summary collapse

ALLOWED_ORDER_FROM =
%w[username created_at].freeze
DEFAULT_ORDER =
{ username: :asc }.freeze

Constants inherited from ElabsPublicController

ElabsPublicController::ALLOWED_NESTED_FROM, ElabsPublicController::IS_NSFW_FILTERABLE, ElabsPublicController::MAX_ITEMS_PER_PAGE

Instance Method Summary collapse

Instance Method Details

#indexObject

GET /users GET /users.json

[View source]

10
11
12
# File 'app/controllers/elabs/users_controller.rb', line 10

def index
  @users = scope_request User.page(params[:page]).per(self.class::MAX_ITEMS_PER_PAGE)
end

#showObject

GET /users/1 GET /users/1.json

[View source]

16
17
18
19
20
21
22
# File 'app/controllers/elabs/users_controller.rb', line 16

def show
  @user_albums   = @user.albums.for_relation
  @user_articles = @user.articles.for_relation
  @user_notes    = @user.notes.for_relation
  @user_projects = @user.projects.for_relation
  @user_uploads  = @user.uploads.for_relation
end