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.
-
#index ⇒ Object
get /users.
-
#new ⇒ Object
get /users/new.
-
#update ⇒ Object
patch /users/:id.
Instance Method Details
#check ⇒ Object
post /users/check
14 15 16 |
# File 'app/controllers/users_controller.rb', line 14 def check @entity = User.new(creation_parameters) end |
#create ⇒ Object
post /users
24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/users_controller.rb', line 24 def create @entity = User.new(creation_parameters) if @entity.save NetworkUserSyncJob.perform_later(@entity.id, false) form_processed_ok(admin_user_path(id: @entity.id)) else form_processed_with_error(:new) end end |
#destroy ⇒ Object
delete /users/:id
51 52 53 54 55 56 |
# File 'app/controllers/users_controller.rb', line 51 def destroy if @entity.destroy #update(deleted: true) flash[:notice] = t('users.destroy.success') end redirect_to admin_users_path end |
#edit ⇒ Object
get /users/:id/edit
36 37 |
# File 'app/controllers/users_controller.rb', line 36 def edit end |
#index ⇒ Object
get /users
8 9 10 11 |
# File 'app/controllers/users_controller.rb', line 8 def index @filter = params[:filter] || Hash.new @collection = User.page_for_visitors(current_page, @filter) end |
#new ⇒ Object
get /users/new
19 20 21 |
# File 'app/controllers/users_controller.rb', line 19 def new @entity = User.new(consent: true) end |
#update ⇒ Object
patch /users/:id
40 41 42 43 44 45 46 47 48 |
# File 'app/controllers/users_controller.rb', line 40 def update if @entity.update(entity_parameters) NetworkUserSyncJob.perform_later(@entity.id, true) form_processed_ok(admin_user_path(id: @entity.id)) else form_processed_with_error(:edit) end end |