This can come in real handy when using shared partials such as a sidebar. Just place this in your view/partial

<% @posts ||= Post.all %>