diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index f5cdcc7..af4a450 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -161,9 +161,8 @@ class CommentsController < ApplicationController end def index - @rss_link ||= "" + @rss_link ||= { :title => "RSS 2.0 - Newest Comments", + :href => "/comments.rss#{@user ? "?token=#{@user.rss_token}" : ""}" } @heading = @title = "Newest Comments" @cur_url = "/comments" diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index d0ba364..edc7b6c 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -22,9 +22,8 @@ class HomeController < ApplicationController def index @stories = find_stories - @rss_link ||= "" + @rss_link ||= { :title => "RSS 2.0", + :href => "/rss#{@user ? "?token=#{@user.rss_token}" : ""}" } @heading = @title = "" @cur_url = "/" @@ -48,9 +47,8 @@ class HomeController < ApplicationController @heading = @title = "Newest Stories" @cur_url = "/newest" - @rss_link = "" + @rss_link = { :title => "RSS 2.0 - Newest Items", + :href => "/newest.rss#{@user ? "?token=#{@user.rss_token}" : ""}" } respond_to do |format| format.html { render :action => "index" } @@ -85,6 +83,10 @@ class HomeController < ApplicationController @heading = @title = "Recent Stories" @cur_url = "/recent" + # our content changes every page load, so point at /newest.rss to be stable + @rss_link = { :title => "RSS 2.0 - Newest Items", + :href => "/newest.rss#{@user ? "?token=#{@user.rss_token}" : ""}" } + render :action => "index" end @@ -96,10 +98,8 @@ class HomeController < ApplicationController @heading = @title = @tag.description.blank?? @tag.tag : @tag.description @cur_url = tag_url(@tag.tag) - @rss_link = "" + @rss_link = { :title => "RSS 2.0 - Tagged #{@tag.tag} (#{@tag.description})", + :href => "/t/#{@tag.tag}.rss" } respond_to do |format| format.html { render :action => "index" } diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 8f17f9c..c95a8b5 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -25,7 +25,8 @@ <% end %> <%= csrf_meta_tags %> <% if @rss_link %> - <%= raw(@rss_link) %> + <% end %>