Class: UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- UsersController
- Defined in:
- app/controllers/users_controller.rb
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
8 9 10 |
# File 'app/controllers/users_controller.rb', line 8 def check @entity = User.new(creation_parameters) end |
#create ⇒ Object
post /users
18 19 20 21 22 23 24 25 |
# File 'app/controllers/users_controller.rb', line 18 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
41 42 43 44 45 46 |
# File 'app/controllers/users_controller.rb', line 41 def destroy if @entity.update(deleted: true) flash[:notice] = t('users.destroy.success') end redirect_to admin_users_path end |
#edit ⇒ Object
get /users/:id/edit
28 29 |
# File 'app/controllers/users_controller.rb', line 28 def edit end |
#new ⇒ Object
get /users/new
13 14 15 |
# File 'app/controllers/users_controller.rb', line 13 def new @entity = User.new(consent: true) end |
#update ⇒ Object
patch /users/:id
32 33 34 35 36 37 38 |
# File 'app/controllers/users_controller.rb', line 32 def update if @entity.update(entity_parameters) form_processed_ok(admin_user_path(id: @entity.id)) else form_processed_with_error(:edit) end end |