Class: Alchemy::PagesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Alchemy::PagesController
- Defined in:
- app/controllers/alchemy/pages_controller.rb
Instance Method Summary collapse
-
#show ⇒ Object
Showing page from params.
-
#sitemap ⇒ Object
Renders a search engine compatible xml sitemap.
Methods included from Modules
included, #module_definition_for, register_module
Methods included from ConfigurationMethods
#configuration, #multi_language?, #multi_site?
Instance Method Details
#show ⇒ Object
Showing page from params
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/alchemy/pages_controller.rb', line 9 def show :show, @page if render_fresh_page? respond_to do |format| format.html { render layout: !request.xhr? } format.rss do if @page.contains_feed? render layout: false, handlers: [:builder] else render xml: {error: 'Not found'}, status: 404 end end end end rescue ActionController::UnknownFormat page_not_found! end |
#sitemap ⇒ Object
Renders a search engine compatible xml sitemap.
29 30 31 32 33 34 |
# File 'app/controllers/alchemy/pages_controller.rb', line 29 def sitemap @pages = Page.sitemap respond_to do |format| format.xml { render layout: 'alchemy/sitemap' } end end |