Class: Polivalente::UsersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/polivalente/users_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject



19
20
# File 'app/controllers/polivalente/users_controller.rb', line 19

def edit
end

#indexObject



5
6
# File 'app/controllers/polivalente/users_controller.rb', line 5

def index
end

#showObject



8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/polivalente/users_controller.rb', line 8

def show
  @recent_activities = []

  # Sudo-random list of user suggestions
  @related_users = @user_class.all
    .where(id: 10.times.map { rand(@user_class.first.id...@user_class.last.id) })
    .where.not(id: @user.id)
    .latest
    .first(4)
end

#updateObject



22
23
24
25
26
27
28
# File 'app/controllers/polivalente/users_controller.rb', line 22

def update
  if @user.update(user_params)
    render :show
  else
    render :edit
  end
end