Class: UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- UsersController
- Defined in:
- app/controllers/users_controller.rb
Overview
Managing users
Instance Method Summary collapse
-
#check ⇒ Object
post /users/check.
-
#create ⇒ Object
post /users.
-
#destroy ⇒ Object
delete /users/:id.
-
#edit ⇒ Object
get /users/:id/edit.
-
#new ⇒ Object
get /users/new.
-
#update ⇒ Object
patch /users/:id.
Instance Method Details
#check ⇒ Object
post /users/check
11 12 13 |
# File 'app/controllers/users_controller.rb', line 11 def check @entity = User.new(creation_parameters) end |
#create ⇒ Object
post /users
21 22 23 24 25 26 27 28 |
# File 'app/controllers/users_controller.rb', line 21 def create @entity = User.new(creation_parameters) if @entity.save form_processed_ok(admin_user_path(id: @entity.id)) else form_processed_with_error(:new) end end |
#destroy ⇒ Object
delete /users/:id
44 45 46 47 48 |
# File 'app/controllers/users_controller.rb', line 44 def destroy flash[:notice] = t('users.destroy.success') if @entity.destroy #update(deleted: true) redirect_to admin_users_path end |
#edit ⇒ Object
get /users/:id/edit
31 32 |
# File 'app/controllers/users_controller.rb', line 31 def edit end |
#new ⇒ Object
get /users/new
16 17 18 |
# File 'app/controllers/users_controller.rb', line 16 def new @entity = User.new(consent: true) end |
#update ⇒ Object
patch /users/:id
35 36 37 38 39 40 41 |
# File 'app/controllers/users_controller.rb', line 35 def update if @entity.update(entity_parameters) form_processed_ok(admin_user_path(id: @entity.id)) else form_processed_with_error(:edit) end end |