Class: Alchemy::PagesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/alchemy/pages_controller.rb

Instance Method Summary collapse

Methods included from Modules

included, #module_definition_for, register_module

Methods included from ConfigurationMethods

#configuration, #multi_language?, #multi_site?

Instance Method Details

#showObject

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
  authorize! :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

#sitemapObject

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