Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix xml_sidebar

  • Loading branch information...
commit 07111d9199c7c162f9f64e204ee2393d5c8d7990 1 parent 3eddcf8
@shingara shingara authored
View
12 app/helpers/sidebar_helper.rb
@@ -28,4 +28,16 @@ def render_sidebar(sidebar)
end
end
+ def articles?
+ not Article.first.nil?
+ end
+
+ def trackbacks?
+ not Trackback.first.nil?
+ end
+
+ def comments?
+ not Comment.first.nil?
+ end
+
end
View
6 vendor/plugins/xml_sidebar/views/content.rhtml
@@ -1,12 +1,12 @@
<h3><%= _("Syndicate")%></h3>
<ul>
- <% if articles -%>
+ <% if articles? -%>
<li><a href="<%= url_for :controller=>'xml', :action=>'feed', :format => format, :type => 'feed' %>" title="Articles feed"><%= _("Articles")%></a></li>
<% end %>
- <% if comments -%>
+ <% if comments? -%>
<li><a href="<%= url_for :controller=>'xml', :action=>'feed', :format => format, :type => 'comments' %>" title="Comments feed"><%= _("Comments")%></a></li>
<% end %>
- <% if trackbacks -%>
+ <% if trackbacks? -%>
<li><a href="<%= url_for :controller=>'xml', :action=>'feed', :format => format, :type => 'trackbacks' %>" title="Trackbacks feed"><%= _("Trackbacks")%></a></li>
<% end %>
</ul>
Please sign in to comment.
Something went wrong with that request. Please try again.