Class: Landable::Api::PageRevisionsController
Constant Summary
Landable::ApiController::API_MEDIA_REGEX
Instance Method Summary
collapse
#api_media
Instance Method Details
#index ⇒ Object
8
9
10
11
|
# File 'app/controllers/landable/api/page_revisions_controller.rb', line 8
def index
page = Page.find(params[:page_id])
respond_with page.revisions.order(:ordinal).reverse
end
|
#revert_to ⇒ Object
22
23
24
25
26
|
# File 'app/controllers/landable/api/page_revisions_controller.rb', line 22
def revert_to
revision = PageRevision.find(params[:id])
revision.page.revert_to! revision
respond_with revision
end
|
#screenshots ⇒ Object
28
29
30
31
32
33
|
# File 'app/controllers/landable/api/page_revisions_controller.rb', line 28
def screenshots
Landable::ScreenshotService.call PageRevision.find(params[:id])
render json: {}, status: 202
end
|
#show ⇒ Object
13
14
15
16
17
18
19
20
|
# File 'app/controllers/landable/api/page_revisions_controller.rb', line 13
def show
revision = PageRevision.find(params[:id])
respond_to do |format|
format.json { respond_with revision }
format.html { respond_with revision.snapshot, responder: Landable::PageRenderResponder }
end
end
|