For instance, i want to have my sidebar to have several dynamic content. Using other method will lead me to put query codes into View, which is not a good idea at all. I would like to keep any query in my Controller.
Currently as i know there are several ff. method:
Render a shared partial -> No where to put the query
render :partial => "shared/sidebar"
Content For -> Additional details in the comment
<%= yield :sidebar %>
<% content_for :sidebar do %>
<a href="http://www.netscape.com">Netscape</a><br>
<a href="http://www.lycos.com">Lycos</a><br>
<a href="http://www.walmart.com">Wal Mart</a><br>
<% end %>
3rd is write it directly to the layout file.
So how should I make this work?