Commit a4d1c5c8

mo k <mo@mokhan.ca>
2012-09-27 12:39:10
add tutorials to the sitemap.
1 parent fa9b637
Changed files (2)
app
app/controllers/sitemap_controller.rb
@@ -3,6 +3,7 @@ class SitemapController < ApplicationController
 
   def index
     @creations = Creation.all
+    @tutorials = Tutorial.all
     @base_url = "http://#{request.host_with_port}"
     headers['Content-Type'] = 'application/xml'
     respond_to do |format|
app/views/sitemap/index.xml.erb
@@ -9,4 +9,11 @@
       <priority>0.5</priority>
     </url>
 <% end %>
+<% @tutorials.each do |tutorial| %>
+    <url>
+      <loc><%="#{@base_url}#{url_for(tutorial)}"%></loc>
+      <lastmod><%= tutorial.updated_at.strftime('%Y-%m-%dT%H:%M-06:00') %></lastmod>
+      <priority>0.5</priority>
+    </url>
+<% end %>
 </urlset>