<% @sidebar_links.each do |link| image = link.delete(:image) name = link.delete(:name) href = link.delete(:href) if(href) %>
<%= content_tag("a", tag("img", :src => image), {:href => href}) %> <%= content_tag("a", name, {:href => href}) %>
<% else %>
<%= link_to_image(image, link) %> <%= link_to(name, link) %>
<% end %> <% end %>
<%= @content_for_layout %>