Class: Kuroko2ReadOnly::SettingsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/kuroko2_read_only/settings_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user

Instance Method Details

#showObject



3
4
5
# File 'app/controllers/kuroko2_read_only/settings_controller.rb', line 3

def show
  @users = Kuroko2::User.where.not(id: current_user.id)
end

#updateObject



7
8
9
10
11
12
13
14
# File 'app/controllers/kuroko2_read_only/settings_controller.rb', line 7

def update
  settings_params.each do |user_id, settings_param|
    user = Kuroko2::User.find(user_id)
    user.update!(read_only: settings_param[:read_only])
  end
  flash[:success] = 'User ReadOnly change complete!!'
  redirect_to settings_path
end