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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:25:50+00:00 2026-06-17T22:25:50+00:00

I have a Rails 3.2 app using Twitter Bootstrap and bootstrap-lightbox. Each record (person)

  • 0

I have a Rails 3.2 app using Twitter Bootstrap and bootstrap-lightbox.

Each record (person) in the database has a field named “map”. This field contains the PNG file I need to show for that record.

The lightbox is generated, and the HTML when I view source shows that the correct PNG file is being loaded. However, when you look at the images (or right click on them to save them) it’s clear that only the first image is being rendered by the lightbox. Every record shows the first image in the lightbox. Here is my code:

<td><!--  lightbox code -->
            <a data-toggle="lightbox" href="#demoLightbox"><%= image_tag "map_icon1.png", :width => '32' %> </a>
            <div id="demoLightbox" class="lightbox hide fade"  tabindex="-1" role="dialog" aria-hidden="true">
                <div class='lightbox-header'>
                    <button type="button" class="close" data-dismiss="lightbox" aria-hidden="true">&times;</button>
                </div>
                <div class='lightbox-content'>
                    <%=image_tag person.map %>
                </div>
            </div>
            <!-- end lightbox code -->
        </td>

Here is what’s being generated by the page:

×

<td><!--  lightbox code -->
            <a data-toggle="lightbox" href="#demoLightbox"><img alt="Map_icon1" src="/assets/map_icon1.png" width="32" /> </a>
                <div id="demoLightbox" class="lightbox hide fade"  tabindex="-1" role="dialog" aria-hidden="true">
                    <div class='lightbox-header'>
                        <button type="button" class="close" data-dismiss="lightbox" aria-hidden="true">&times;</button>
                    </div>
                    <div class='lightbox-content'>
                        <img alt="G2" src="/assets/g2.png" />
                    </div>
                </div>
                <!-- end lightbox code -->

I know this code isn’t the cleanest, I pretty much hacked it together. But if the HTML is showing each file is being rendered, how come the lightbox is only showing the first png and using that for every record?

The image g2.png is what’s being shown in the lightbox for every record. Even though the code shows that i2.png etc. are being rendered.

Thanks in advance.

  • 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-17T22:25:51+00:00Added an answer on June 17, 2026 at 10:25 pm

    Well, this is proof that a good night’s sleep is sometimes all you need.

    The problem was I didn’t have unique values for the HREF and the DIV ID.

    Once I changed my code to create unique values based on the record ID’s it all worked fine. Here is my final code.

    <td><!--  lightbox code -->
                <a data-toggle="lightbox" href="#<%= person.id %>Lightbox"><%= image_tag "map_icon1.png", :width => '32' %> </a>
                <div id="<%= person.id %>Lightbox" class="lightbox hide fade"  tabindex="-1" role="dialog" aria-hidden="true">
                    <div class='lightbox-header'>
                        <button type="button" class="close" data-dismiss="lightbox" aria-hidden="true">&times;</button>
                    </div>
                    <div class='lightbox-content'>
                        <%=image_tag person.map %>
                    </div>
                </div>
                <!-- end lightbox code -->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using http://twitter.github.com/bootstrap/javascript.html#tooltips on a app. I have this rails code: <%= link_to t('.shipping_details'),
I have a Rails 3.2.5 app that is using Twitter Bootstrap. I am trying
I have a Rails app with Twitter Bootstrap installed. Bootstrap encapsulates each navigation bar
I have a rails 3.2 app using Twitter Bootstrap via the gem ' twitter-bootstrap-rails
I have deployed a rails app on Heroku, and I am using the twitter-bootstrap-rails
I am using twitter bootstrap in my rails app, and I am constructing a
Im using twitter-bootstrap in my rails app i was following this tutorial : http://untame.net/2012/08/twitter-bootstrap-build-a-stunning-two-column-blog/
In my rails app, I'm using Twitter bootstrap. Before, everything was working fine, but
Going nuts here. I'm developing a rails app, and I'm using the twitter-bootstrap-rails gem
I am working on a really simple app that is styled using twitter-bootstrap-rails. One

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.