Class: Archangel::Backend::UsersController
- Inherits:
-
Archangel::BackendController
- Object
- ActionController::Base
- ApplicationController
- Archangel::BackendController
- Archangel::Backend::UsersController
- Includes:
- Controllers::ResourcefulConcern
- Defined in:
- app/controllers/archangel/backend/users_controller.rb
Overview
Backend users controller
Instance Method Summary collapse
-
#create ⇒ Object
Invite backend user.
-
#update ⇒ Object
Update backend user.
Methods included from Controllers::ResourcefulConcern
#destroy, #edit, #index, #new, #show
Methods included from Helpers::ActionableConcern
#action, #collection_action?, #member_action?
Methods included from Controllers::MetatagableConcern
Methods inherited from ApplicationController
#current_site, #render_401_error, #render_404_error, #render_error
Methods included from Controllers::PaginatableConcern
Instance Method Details
#create ⇒ Object
Invite backend user
Formats
HTML, JSON
Request
POST /backend/users
POST /backend/users.json
Parameters
{
"user": {
"name": "First Last",
"username": "user_name",
"role": "editor",
"avatar": "/uploads/file.png",
"email": "[email protected]"
}
}
35 36 37 38 39 |
# File 'app/controllers/archangel/backend/users_controller.rb', line 35 def create user = resource_new_content respond_with user, location: -> { location_after_create } end |
#update ⇒ Object
Update backend user
Formats
HTML, JSON
Params
[String] slug - the user username
Request
PATCH /backend/users/:slug
PATCH /backend/users/:slug.json
PUT /backend/users/:slug
PUT /backend/users/:slug.json
Parameters
{
"user": {
"name": "First Last",
"username": "user_name",
"role": "editor",
"avatar": "/uploads/file.png",
"email": "[email protected]"
}
}
67 68 69 70 71 72 73 |
# File 'app/controllers/archangel/backend/users_controller.rb', line 67 def update user = resource_content user.update_without_password(resource_params) respond_with user, location: -> { location_after_update } end |