Skip to content

Instantly share code, notes, and snippets.

@pmaojo
Last active March 13, 2017 13:54
Show Gist options
  • Save pmaojo/fd4ca77bb4c036c7a37a399ef556aa2e to your computer and use it in GitHub Desktop.
Save pmaojo/fd4ca77bb4c036c7a37a399ef556aa2e to your computer and use it in GitHub Desktop.
haml loop de posts con banner cada cuatro posts
- n = 0
- @posts.each_with_index do |post, i|
%p= post.title
- if n < @banners.count
- if ((i+1) % 3 == 0)
%p= @banners.drop[n].first.title
- n += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment