Class: Archangel::Frontend::PagesController
- Inherits:
-
Archangel::FrontendController
- Object
- ActionController::Base
- ApplicationController
- Archangel::FrontendController
- Archangel::Frontend::PagesController
- Defined in:
- app/controllers/archangel/frontend/pages_controller.rb
Overview
Frontend pages controller
Direct Known Subclasses
Instance Method Summary collapse
-
#show ⇒ Object
Frontend page.
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
#show ⇒ Object
Frontend page
Formats
HTML, JSON
Params
[String] permalink - the permalink to the page
Request
GET /:permalink
GET /:permalink.json
Response
{
"id": 123,
"title": "Page Title",
"permalink": "/path/to/page",
"content": "</p>Content of the page</p>",
"homepage": false,
"published_at": "YYYY-MM-DDTHH:MM:SS.MSZ",
"created_at": "YYYY-MM-DDTHH:MM:SS.MSZ",
"updated_at": "YYYY-MM-DDTHH:MM:SS.MSZ",
}
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/controllers/archangel/frontend/pages_controller.rb', line 41 def show return render_or_redirect_to_homepage if redirect_to_homepage? respond_to do |format| format.html do render inline: liquid_rendered_design_content, layout: layout_from_theme end format.json do @page.content = liquid_rendered_content render(template: "archangel/frontend/pages/show", layout: false) end end end |