I think you want to output a new% ul every time @i%3 == 0, and then put the tags %li. You can do the following:
-@activities.in_groups_of(3, false) do |activity_group|
%ul
-activity_group.each do |activity|
%li=link_to activity.name, activity
To learn more about the topic, visit: http://railscasts.com/episodes/28-in-groups-of
Hope this helps.
source
share