This is my code:
-@activities.each do |a|
-if @i%3 == 0
%ul
%li=link_to a.name, a
-@i += 1
I need the li to be inside the ul which is inside the if-statement.
I can’t do it because of the indentation. Can’t I just tell the li to indent automatically?
Thanks
I think you would like to output a new %ul each time when
@i%3 == 0and then put the%litags there. You can do like the following:To see more information about the topic please visit: http://railscasts.com/episodes/28-in-groups-of