What's the best way to grab the flash errors and print them in a view?

I found this code on the web, but I am getting a compile error:

<% unless my_model.errors.empty? %>
<p>There were errors saving the data!</p>
<ul>
<% my_model.errors.full_messages.each |message| %>
<li><%= message %></li>
<% end %>
</ul>
<% end %>


Here are the error messages:

Showing app/views/feeds/_form.rhtml where line #4 raised:

compile error
/Users/robertgremillion/workspace/reminderfeed/public/../config/../app/views/feeds/_form.rhtml:4: parse error, unexpected ';'
_erbout.concat " "; @feed.errors.full_messages.each |message| ; _erbout.concat "\n"
^
/Users/robertgremillion/workspace/reminderfeed/public/../config/../app/views/feeds/_form.rhtml:46: parse error, unexpected kEND, expecting $

Extracted source (around line #4):

1: <% unless @feed.errors.empty? %>
2: <p>There were errors saving the data!</p>
3: <ul>
4: <% @feed.errors.full_messages.each |message| %>
5: <li><%= message %></li>
6: <% end %>
7: </ul>


What am I doing wrong?

Thanks!