Class: IndexController

Inherits:
ApplicationController show all
Defined in:
lib/forge/app/controllers/index_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#app_init

Instance Method Details

#indexObject



2
3
4
5
6
7
8
# File 'lib/forge/app/controllers/index_controller.rb', line 2

def index
  @page = Page.find_by_key("home")
  respond_to do |format|
    format.html {}
    format.mobile { render :template => "mobile/page" }
  end
end

#sitemapObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/forge/app/controllers/index_controller.rb', line 10

def sitemap
  respond_to do |format|
    format.html do
      @pages = Page.published.all
    end

    format.xml do
      @homepage = Page.find_by_title('Home') # anything that responds to updated_at, for the homepage
      @models = @@models ||= YAML.load(Rails.root.join('config', 'google_sitemap.yml').read)
    end
  end
end