I am doing a ruby on rails archive blog.The backend works fine but the year displays seperately as you can see in the below image
As you can see in the image above the years are coming seperately.But if I give some blog in the same month it works fine as you can see in the month of august 2014
(accident,Politics) but not for 2014.
This is the controller
@posts_by_month = Cutting.find(:all, :order => "date DESC").group_by { |post| post.date.beginning_of_month }
the view
<div class="easy-tree" style="float:left;width:300px;background: #aaaaaa;">
<%# @post_months.sort.reverse.each do |month, posts| %>
<%@posts_by_month.each do |month, posts|%>
<ul>
<li><%=h month.strftime("%G")%>
<ul>
<li><%=h month.strftime("%B") %>
<!--li ><%=h month.strftime %>-->
<ul>
<% for post in posts %>
<li style="background: #aaaaaa;"class="getid" name ="<%=post.id%>"><%=h link_to post.subject%></li>
<% end %>
</ul>
<!--/li-->
</li>
</ul>
</li>
</ul>
<% end %>
</div>
I am using easy-tree for getting the ui for