aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/blog/posts_controller.rb12
-rw-r--r--app/views/blog/posts/index.rss.builder17
2 files changed, 25 insertions, 4 deletions
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb
index abb870d..a0340b7 100644
--- a/app/controllers/blog/posts_controller.rb
+++ b/app/controllers/blog/posts_controller.rb
@@ -2,12 +2,16 @@ class Blog::PostsController < BlogController
before_filter :find_all_blog_posts
before_filter :find_blog_post, :only => [:show, :comment]
-
+
+ def index
+ respond_to do |format|
+ format.html
+ format.rss
+ end
+ end
+
def show
@blog_comment = BlogComment.new
-
- # you can use meta fields from your model instead (e.g. browser_title)
- # by swapping @page for @blogs in the line below:
present(@page)
end
diff --git a/app/views/blog/posts/index.rss.builder b/app/views/blog/posts/index.rss.builder
new file mode 100644
index 0000000..d9ad0da
--- /dev/null
+++ b/app/views/blog/posts/index.rss.builder
@@ -0,0 +1,17 @@
+xml.instruct! :xml, :version => "1.0"
+xml.rss :version => "2.0" do
+ xml.channel do
+ xml.title RefinerySetting.find_or_set(:site_name, "Company Name")
+ xml.description RefinerySetting.find_or_set(:site_name, "Company Name") + " Blog Posts"
+ xml.link blog_root_url
+
+ @blog_posts.each do |post|
+ xml.item do
+ xml.title post.title
+ xml.description post.body
+ xml.pubDate post.created_at.to_s(:rfc822)
+ xml.link blog_post_url(post)
+ end
+ end
+ end
+end \ No newline at end of file