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 inherited from ApplicationController
#current_site, #render_401_error, #render_404_error, #render_error
Methods included from PaginatableConcern
Methods included from ActionableConcern
#action, #collection_action?, #edit_action?, #index_action?, #member_action?, #new_action?, #restful_action?, #save_action?, #show_action?
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"
}
},
"content": "</p>Content of the Widget</p>",
"template_id": 123
}
91 92 93 94 95 |
# File 'app/controllers/archangel/backend/sites_controller.rb', line 91 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"
}
},
"content": "</p>Content of the Widget</p>",
"template_id": 123,
"deleted_at": null,
"created_at": "YYYY-MM-DDTHH:MM:SS.MSZ",
"updated_at": "YYYY-MM-DDTHH:MM:SS.MSZ"
}
50 51 52 53 54 |
# File 'app/controllers/archangel/backend/sites_controller.rb', line 50 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"
}
},
"content": "</p>Content of the Widget</p>",
"template_id": 123
}
}
135 136 137 138 139 140 141 |
# File 'app/controllers/archangel/backend/sites_controller.rb', line 135 def update site = resource_content site.update(resource_params) respond_with site, location: -> { location_after_update } end |