The original article had an error, and your solution is correct. Here's the reason:

The output of ruby code in an ERB (view) that is encased in <%= %> gets added to the HTML that's generated and sent to the browser. The output of ruby code that is encase in <% %> does not get added to the HTML. So calling <% render :partial ... %> has no effect since the result of that ruby code (fetching the partial) isn't added to the generated HTML file.

<% %> is generally reserved for conditionals and loops, as you have in the example above.