%
first_days = (1..12).map do |index|
Date.new(@year, index, 1).beginning_of_month
end
%>
<%= link_to (@year-1), root_path(year: @year-1) %>
<%= @year %>
<%= link_to (@year+1), root_path(year: @year+1) %>
<% first_days.each do |first_day| %>
<%= render 'month', first_day: first_day, events: @events %>
<% end %>