<% recent_channels = Channel.recent_channels(current_user, 1) %>
<ul class="channels">
  <li>
    <%= link_to "Home", root_path %>
  </li>
  <% recent_channels.each do |c| %>
    <li>
      <% unread = c.num_unread(current_user); mentions = c.num_mentions(current_user) %>
      <%= link_to c.title, channel_path(c) %>
      <% if unread >  0 || mentions > 0%>
        <div class="channel">
          <% if mentions > 0 %><div class="post-count mentions"><%= mentions %></div><% end %>
          <% if unread > 0 %><div class="post-count unread"><%= unread %></div><% end %>
        </div>
      <% end %>
    </li>
  <% end %>
</ul>

<% recent_channels = Channel.recent_channels(current_user, 1) %>
<ul class="channels">
  <li>
    <%= link_to "Home", root_path %>
  </li>
  <% recent_channels.each do |c| %>
    <li>
      <% unread = c.num_unread(current_user); mentions = c.num_mentions(current_user) %>
      <%= link_to c.title, channel_path(c, :anchor => channel_anchor(c, current_user)) %>
      <% if unread >  0 || mentions > 0%>
        <div class="channel">
          <% if mentions > 0 %><div class="post-count mentions"><%= mentions %></div><% end %>
          <% if unread > 0 %><div class="post-count unread"><%= unread %></div><% end %>
        </div>
      <% end %>
    </li>
  <% end %>
</ul>

Set link anchor in sidebar
Set link anchor in sidebar
