Class: Archangel::Backend::SitesController
- Inherits:
-
Archangel::BackendController
- Object
- ActionController::Base
- ApplicationController
- Archangel::BackendController
- Archangel::Backend::SitesController
- Defined in:
- app/controllers/archangel/backend/sites_controller.rb
Overview
Backend sites controller
Instance Method Summary collapse
-
#edit ⇒ Object
Edit backend site.
-
#show ⇒ Object
Backend site.
-
#update ⇒ Object
Update backend site.
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
#edit ⇒ Object
Edit backend site
Formats
HTML, JSON
Request
GET /backend/site/edit
GET /backend/site/edit.json
Response
{
"id": 123,
"name": "Site Name",
"theme": "my_theme",
"locale": "en",
"logo": {
"url": "/uploads/file.png",
"large": {
"url": "/uploads/large_file.png"
},
"medium": {
"url": "/uploads/medium_file.png"
},
"small": {
"url": "/uploads/small_file.png"
},
"tiny": {
"url": "/uploads/tiny_file.png"
}
}
}
86 87 88 89 90 |
# File 'app/controllers/archangel/backend/sites_controller.rb', line 86 def edit site = resource_content respond_with site end |
#show ⇒ Object
Backend site
Formats
HTML, JSON
Request
GET /backend/site
GET /backend/site.json
Response
{
"id": 123,
"name": "Site Name",
"theme": "my_theme",
"locale": "en",
"logo": {
"url": "/uploads/file.png",
"large": {
"url": "/uploads/large_file.png"
},
"medium": {
"url": "/uploads/medium_file.png"
},
"small": {
"url": "/uploads/small_file.png"
},
"tiny": {
"url": "/uploads/tiny_file.png"
}
}
}
47 48 49 50 51 |
# File 'app/controllers/archangel/backend/sites_controller.rb', line 47 def show site = resource_content respond_with site end |
#update ⇒ Object
Update backend site
Formats
HTML, JSON
Request
PATCH /backend/site
PATCH /backend/site.json
PUT /backend/site
PUT /backend/site.json
Response
{
"site": {
"name": "Site Name",
"theme": "my_theme",
"locale": "en",
"logo": {
"url": "/uploads/file.png",
"large": {
"url": "/uploads/large_file.png"
},
"medium": {
"url": "/uploads/medium_file.png"
},
"small": {
"url": "/uploads/small_file.png"
},
"tiny": {
"url": "/uploads/tiny_file.png"
}
}
}
}
128 129 130 131 132 133 134 |
# File 'app/controllers/archangel/backend/sites_controller.rb', line 128 def update site = resource_content site.update(resource_params) respond_with site, location: -> { location_after_update } end |