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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:16:46+00:00 2026-05-30T14:16:46+00:00

New to rails. Trying to add a background with css to the loop area

  • 0

New to rails. Trying to add a background with css to the loop area of my code but it seems to not read in the area. Any css applied before or after the rails loop function is shown but the background stops right before everything in the museum.each do loop. Any help?

scaffold.css.css:

#museums {
    background: #ccc;
}

index:

<div id="museums">
<h1> Museums </h1>
<% @museums.each do |museum| %>
    <div class="museumAdd">
        <div class="name"><%= museum.name %></div>
        <div class="description"><%= museum.description %></div>
        <div class="location"><%= museum.city %>, 
        <%= museum.state %></div><br />

        <div class="edit">
            <%= link_to 'View', museum %><br />
            <%= link_to 'Edit', edit_museum_path(museum) %><br />
            <%= link_to 'Delete', museum, :confirm => 'Are you sure?', :method => :delete %>
        </div>
    </div>
<% end %>
</div>
  • 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-30T14:16:47+00:00Added an answer on May 30, 2026 at 2:16 pm

    You have not provided enough information to answer the question with certainty, and I don’t have enough karma/circus points/whatever to ask questions as a comment yet.

    Oh well, I do have a pretty good guess though. This is not a Rails problem. You could be using anything back there. This is a CSS problem. From the comments under your question, it sure sounds like a classic “container not enclosing its floats” issue, even though I cannot ask you if the things inside #museum are floated. Are they? Adding a set height fits the classic symptoms.

    There are about a gazillion different float-clearing and -enclosing techniques out there. Assuming you do NOT have a height set on your div now, a quick way to check is, does the problem go away if you give #museums overflow: hidden?

    Overflow:hidden is not always the best float-enclosing method but it’s good 90+% of the time. Try it and report back.

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

Sidebar

Related Questions

I'm making Rails 3.1.1 app and trying to add some jQuery code to it.
I'm quite new to ruby and ruby on rails and I'm trying to add
I'm fairly new to Rails and am trying to figure out how to add
I'm fairly new to Rails and am trying to figure out how to add
I'm trying to add a fields_for attribute to a nested rails form. Any time
I'm trying to use user_signed_in? to add a login area to my rails 3
Relatively new to rails and trying to model a very simple family tree with
I'm trying to put some specs around a new rails 3 project I am
I'm new to rails and I'm trying to test a controller with rspec. My
I'm new to rails and cucumber and I'm trying to test the following scenario

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.