listing recent items from layout help

I've just started programming in Rails, so my comment may not count
for much, but it seems to me that you're trying to put a method in the
layout, and layouts, as far as I know, accepts built-in helper
methods. Because it's not correlated with the folder named off of the
controller you're using, the layout can't find the variable @rposts;
layouts doesn't receive any data from the controller branching off of
Application Controller.

I'd advise you to create a partial instead. Partials are rhtml files
whose name starts with an underscore (for example: '_post.rhtml').
Put that into the controller file, and then bring that up in the
layout via the code line: <%=render(:partial=>"post")%>

If it's in a controller, make a private (actually, leaving it public
is fine, but private gives better security :-)) method that has that
one line: