Try this
images.each_slice(15) do |photo|
%tr
%td
...
Check what each_slice gives you to get the result you want.
Cheers.
Question
I have this code snippet in my view:
%table
%tr
- images.each do |photo|
%td
.image
= cl_image_tag(photo.path, size: BOTTLE_IMAGE_SIZE_FOR_AA_MANAGE_UPLOAD_PAGE)
- if images.count > 1
= radio_button_tag 'upload', photo.id, photo.is_primary, class: 'manage_uploads'
Currently if I have more than 15 images, all of them are shown on the same row. I want that if I have more than 15 images, it should display it on the new line i.e new "tr". I am unable to figure out a clean and simple way to achieve this.
Solution
Try this
images.each_slice(15) do |photo|
%tr
%td
...
Check what each_slice gives you to get the result you want.
Cheers.