I have the following situation in my rails project
application.html.erb:
...
<%= render :partial => 'layouts/sidebar' %>
<%= yield %>
...
_sidebar.html.erb:
<% @groups.each do |group| %>
<li><%= link_to group.name, "#" %></li>
<% end %>
Sidebar consists of a list of groups which doesn't change often. That's why i don't want to query the list in DB every time I go to another page in content part (yield). Is there a way how can i preserve the list throughout several pages? I KNOW about the sessions and caches, but maybe there is a better solution.
Thanks