Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6961833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:34:53+00:00 2026-05-27T15:34:53+00:00

I would like to display items for an e-commerce page in Rails, and instead

  • 0

I would like to display items for an e-commerce page in Rails, and instead of a standard vertical list table, I would like to the title and images from left to right, about 4 across, then continue the list on as added: ie.

Entry 1 Entry 2 Entry 3 Entry 4

Entry 5 Entry 6 ….

My first guess is to make a scope for each column- where I could skip entries by a factor of 4, but I would like to know if there is a better solution using CSS or any other trick?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:34:54+00:00Added an answer on May 27, 2026 at 3:34 pm

    There’s a method on Enumerable which is called each_slice. Basically what it does is give you slices of an array.

    (1..10).each_slice(3) {|a| p a}
    # outputs below
    [1, 2, 3]
    [4, 5, 6]
    [7, 8, 9]
    [10]
    

    Another option using CSS would be to have a container of fixed width, say 400px, and then have each of the elements have width: 100px and float: left, so they’ll line up one after another.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to display items from a Queue in a Gridview in Windows
I would like to at least display items from the email inbox. (Similar to
I would like to have the list items display horizontally and I want to
I would like to style a <ul> to display all items in a box
I would like to display tagcloud in my home page. Found this wordpress flash
When a user moves the Google map, I would like to display items in
I need to display list of news items from a database on a web
I have a set of three list items that I would like to automatically
I would like to control the menu display (show/hide menu items) in my ASP.NET
I would like to select list items based on their incrementing ID's but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.