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

  • SEARCH
  • Home
  • 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 8139285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:46:35+00:00 2026-06-06T11:46:35+00:00

I have a each block something like: <% for f in @following %> <div

  • 0

I have a each block something like:

<% for f in @following %>
 <div class="span6">
  <%= f.name %>
 </div>
<% end %>

html result:

<div class="span6"> John</div>
<div class="span6"> kevin</div>
<div class="span6"> Peter</div>
<div class="span6"> Andrew</div>
.
.
.

I want add a <div class="row"></div> each 2 results something like:

<div class="row">
 <div class="span6"> John</div>
 <div class="span6"> kevin</div>
</div>
<div class="row">
 <div class="span6"> Peter</div>
 <div class="span6"> Andrew</div>
</div>

I want show 2 results per/row. How can I do it?

  • 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-06-06T11:46:37+00:00Added an answer on June 6, 2026 at 11:46 am

    Checkout each_slice

    <% @following.each_slice(2) do |followers| %>
      <div class="row">
        <% followers.each do |f| %>
          <div class="span6">
            <%= f.name %>
          </div>
        <% end %>
      </div>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking to create something like in this image. Each block would have an
I currently have the following HTML markup: <td class=title> <img src=my-image.png class=thumbnail /> <span
Let's say I have following table like this <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
I have these div blocks called columns where each column div contains separate two
The following snippet is causing me a QA headache. <div id=links-container> <ul> <li class=resource-link
In my UIViewController descendant, I have a set of four blocks. Each block is
How can I have each of these a elements break on to new lines,
I am to process single PDFs that have each been created by 'merging' multiple
I'm working on a SaaS project that will have each customer having an instance
I am writing an address book program. I have each person's details stored in

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.