:plain :ruby generator = pdfable - generator.members.each_slice(6) do |page| .page - page.each_with_index do |member,index| - membership = member.memberships.current.first - person = member.person - classes = ['card'] - classes << 'odd' if index.odd? - classes << 'top' if [0, 1].include?(index) - classes << 'bottom' if [4,5].include?(index) %div{:class => classes.join(' ')} .left-side .qr-code %img{:src => (member.download_link_for(:qr_code) rescue 'http://placehold.it/120/ffffff.png&text=No+QR+Code')} .right-side .organization-name #{member.organization.name} .membership #{membership.membership_type.name} .person-name #{person.first_name} #{person.last_name} .membership-number ##{member.member_number} .expiration Expires #{membership.ends_at.strftime('%b %d, %Y')}