Class: SiteController

Inherits:
CartoonistController show all
Defined in:
app/controllers/site_controller.rb

Instance Method Summary collapse

Instance Method Details

#faviconObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/site_controller.rb', line 2

def favicon
  respond_to do |format|
    format.html { redirect_to "/" }

    format.ico do
      data = ActionController::Base.helpers.asset_paths.asset_environment[Cartoonist::Theme.favicon].to_s

      cache_page_as "static/favicon.ico" do
        send_data data, :filename => "favicon.ico", :type => "image/x-icon", :disposition => "inline"
      end
    end
  end
end

#robotsObject



16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/site_controller.rb', line 16

def robots
  respond_to do |format|
    format.html { redirect_to "/" }

    format.text do
      cache_page_as "static/robots.txt" do
        render :layout => false
      end
    end
  end
end

#sitemapObject



28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/site_controller.rb', line 28

def sitemap
  respond_to do |format|
    format.html { redirect_to "/" }

    format.xml do
      @entries = load_sitemap_content
      render :content_type => "application/xml", :layout => "cartoonist"
    end
  end
end