Skip to content
This repository
Browse code

fix xml_sidebar

  • Loading branch information...
commit 07111d9199c7c162f9f64e204ee2393d5c8d7990 1 parent 3eddcf8
Cyril Mougel authored November 19, 2008
12  app/helpers/sidebar_helper.rb
@@ -28,4 +28,16 @@ def render_sidebar(sidebar)
28 28
     end
29 29
   end
30 30
 
  31
+  def articles?
  32
+    not Article.first.nil?
  33
+  end
  34
+
  35
+  def trackbacks?
  36
+    not Trackback.first.nil?
  37
+  end
  38
+
  39
+  def comments?
  40
+    not Comment.first.nil?
  41
+  end
  42
+
31 43
 end
6  vendor/plugins/xml_sidebar/views/content.rhtml
... ...
@@ -1,12 +1,12 @@
1 1
 <h3><%= _("Syndicate")%></h3>
2 2
 <ul>
3  
-  <% if articles -%>
  3
+  <% if articles? -%>
4 4
   <li><a href="<%= url_for :controller=>'xml', :action=>'feed', :format => format, :type => 'feed' %>" title="Articles feed"><%= _("Articles")%></a></li>
5 5
   <% end %>
6  
-  <% if comments -%>
  6
+  <% if comments? -%>
7 7
   <li><a href="<%= url_for :controller=>'xml', :action=>'feed', :format => format, :type => 'comments' %>" title="Comments feed"><%= _("Comments")%></a></li>
8 8
   <% end %>
9  
-  <% if trackbacks -%>
  9
+  <% if trackbacks? -%>
10 10
   <li><a href="<%= url_for :controller=>'xml', :action=>'feed', :format => format, :type => 'trackbacks' %>" title="Trackbacks feed"><%= _("Trackbacks")%></a></li>
11 11
   <% end %>
12 12
 </ul>

0 notes on commit 07111d9

Please sign in to comment.
Something went wrong with that request. Please try again.