Module: GryphonSitemap::SitemapController

Defined in:
lib/gryphon_sitemap/sitemap_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
6
# File 'lib/gryphon_sitemap/sitemap_controller.rb', line 3

def index
  @indexes = indexed_pages_cached
  fixup_missing_page_counts
end

#showObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gryphon_sitemap/sitemap_controller.rb', line 8

def show
  item_name = params[:id]
  found_index = indexed_pages_cached[item_name.to_sym]
  page_not_found if found_index.blank?

  if respond_to?item_name
    send(item_name)
  else
    @items = item_name.to_s.classify.constantize.sitemap_page(params[:page].to_i)
    render :generic
  end
end