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 8137039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:57:31+00:00 2026-06-06T10:57:31+00:00

Here is my code: (Thank you MurifoX) <% random_bullets = Bullet.all %> <ul> <%

  • 0

Here is my code: (Thank you MurifoX)

<% random_bullets = Bullet.all %>
<ul>
  <% 4.times do %>
    <li><%= random_bullets.sample.content %></li>
  <% end %>
</ul>

I would like to know if making a condition is possible to prevent any two “bullets” from having the same content on the page. If so, could I get some help on the issue, maybe a nudge in the right direction?

  • 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-06T10:57:34+00:00Added an answer on June 6, 2026 at 10:57 am

    Just remove them from the pool as they are used:

    <% 4.times do %>
      <li><%= random_bullets.delete_at(rand random_bullets.size).content %></li>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok. here's the operations i successfully code so far thank's to your help: Adittion:
Code is much more precise than English; Here's what I'd like to do: import
I'm think something like Facebook apps here. User generated pieces of code that people
I'm making a Grade log application and I have this piece of code here
Here is my sample code: $(window).scroll(function () { if ($(window).scrollTop() >= $(document).height() - $(window).height())
enter code here Just need to know the basics of peeking in scheme. I
Ok, I'll paste my code here, it goes like if a person selects a
Jquery UI autocomplete wont work,what could be wrong?Here is the code.Thank you <head> <meta
here's the code(Where I think the NullPointerException is generated): public String getData(String s1,String s2,String
Here is the code: <div><a><img src= http://www.seeklogo.com/images/R/Random_House_Bertelsmann-logo-B80776D5CA-seeklogo.com.gif/>Test</a>​​​​​​​​​<div>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ Here is the fiddle: http://jsfiddle.net/zjfw2/ Thanks.

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.