Class: Lcms::Engine::Admin::UsersController
Constant Summary
AdminController::RE_GOOGLE_FOLDER
Instance Method Summary
collapse
settings
Methods included from PathHelper
#dynamic_document_path, #dynamic_material_path, #dynamic_path
Instance Method Details
#create ⇒ Object
19
20
21
22
23
24
25
26
27
28
|
# File 'app/controllers/lcms/engine/admin/users_controller.rb', line 19
def create
@user = User.new(user_params)
@user.generate_password
if @user.save
@user.send_reset_password_instructions
redirect_to lcms_engine.admin_users_path, notice: t('.success', user: @user.email)
else
render :new
end
end
|
#destroy ⇒ Object
43
44
45
46
|
# File 'app/controllers/lcms/engine/admin/users_controller.rb', line 43
def destroy
@user.destroy
redirect_to lcms_engine.admin_users_path, notice: t('.success')
end
|
#edit ⇒ Object
30
31
32
|
# File 'app/controllers/lcms/engine/admin/users_controller.rb', line 30
def edit
@url = lcms_engine.admin_user_path(@user)
end
|
#index ⇒ Object
10
11
12
13
|
# File 'app/controllers/lcms/engine/admin/users_controller.rb', line 10
def index
@query = OpenStruct.new @query_params @users = users(@query)
end
|
#new ⇒ Object
15
16
17
|
# File 'app/controllers/lcms/engine/admin/users_controller.rb', line 15
def new
@user = User.new
end
|
#reset_password ⇒ Object
48
49
50
51
|
# File 'app/controllers/lcms/engine/admin/users_controller.rb', line 48
def reset_password
@user.send_reset_password_instructions
redirect_to lcms_engine.admin_users_path, notice: t('.success')
end
|
#update ⇒ Object
34
35
36
37
38
39
40
41
|
# File 'app/controllers/lcms/engine/admin/users_controller.rb', line 34
def update
if @user.update(user_params)
redirect_to lcms_engine.admin_users_path, notice: t('.success', user: @user.email)
else
@url = lcms_engine.admin_user_path(@user)
render :edit
end
end
|