Class: Alchemy::PagesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Alchemy::PagesController
- Defined in:
- app/controllers/alchemy/pages_controller.rb
Constant Summary collapse
- SHOW_PAGE_PARAMS_KEYS =
[ "action", "controller", "urlname", "locale" ]
Instance Method Summary collapse
-
#index ⇒ Object
The index action gets invoked if one requests ‘/’ or ‘/:locale’.
-
#show ⇒ Object
The show action gets invoked if one requests ‘/:urlname’ or ‘/:locale/:urlname’.
-
#sitemap ⇒ Object
Renders a search engine compatible xml sitemap.
Methods included from Modules
included, #module_definition_for, register_module
Methods included from AbilityHelper
Methods included from ConfigurationMethods
#configuration, #multi_language?, #multi_site?, #prefix_locale?
Instance Method Details
#index ⇒ Object
The index action gets invoked if one requests ‘/’ or ‘/:locale’
If the locale is the default locale, then it redirects to ‘/’ without the locale.
Loads the current language root page. The current language is either loaded via :locale parameter or, if that’s missing, the default language is used.
If this page is not published then it redirects to the first published descendant it finds.
If no public page can be found it renders a 404 error.
55 56 57 |
# File 'app/controllers/alchemy/pages_controller.rb', line 55 def index show end |
#show ⇒ Object
The show action gets invoked if one requests ‘/:urlname’ or ‘/:locale/:urlname’
If the locale is the default locale, then it redirects to ‘/’ without the locale.
Loads the page via it’s urlname. If more than one language is published the current language is either loaded via :locale parameter or, if that’s missing, the page language is used and a redirect to the page with prefixed locale happens.
If the requested page is not published then it redirects to the first published descendant it finds. If no public page can be found it renders a 404 error.
70 71 72 73 |
# File 'app/controllers/alchemy/pages_controller.rb', line 70 def show :show, @page render_page if render_fresh_page? end |
#sitemap ⇒ Object
Renders a search engine compatible xml sitemap.
76 77 78 79 80 81 |
# File 'app/controllers/alchemy/pages_controller.rb', line 76 def sitemap @pages = Page.sitemap respond_to do |format| format.xml { render layout: "alchemy/sitemap" } end end |