Merge branch '134_create_moderator'
This commit is contained in:
18
app/controllers/admin/moderators_controller.rb
Normal file
18
app/controllers/admin/moderators_controller.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class Admin::ModeratorsController < Admin::BaseController
|
||||
def index
|
||||
@moderators = User.joins(:moderator).page(params[:page])
|
||||
end
|
||||
def search
|
||||
@email = params[:email]
|
||||
@user = User.find_by(email: @email)
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
def toggle
|
||||
@user = User.find(params[:id])
|
||||
@user.toggle_moderator
|
||||
redirect_to admin_moderators_path
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user