Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Build a Simple Ruby on Rails Application Customizing Forms Installing simple_form

navbar and form-horizontal not working like everyone else but there's a catch I found

Yet another thread on this topic that so many people are having problems with.

Horizontal form isn't working for me either. I noticed that if you open up bootstrap.css 3.1.1 and do a search for

.navbar-inner 

you'll see that it doesn't exist. This is part of the reason why it seems like you only get partial styling when you use bootstrap 3.1.1 The styling for form-horizontal is different in 3.1.1 than 2.0.4.

so I switched to rails 3.2.17 and forgot to put bootstrap 2.0.4. instead of 3.1.1 in my stylesheet folder. So, I copied and pasted the bootstrap 2.0.4 over bootstrap 3.1.1 but after installing simple_form and all the other things you're supposed to do up until this video.

I ran the server and refreshed Chrome. I inspected the form with dev tools. The result was the same. I clicked on the link

<link href="/assets/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css">

in the dev tools window and... ** LO AND BEHOLD! At the top of the file it says bootstrap 3.1.1. **

How can this be? I replaced bootstrap 3.1.1 with 2.0.4. The bootstrap version being used in the browser is 3.1.1. HOW???

In the browser it says 3.1.1 but in my stylesheet folder it's the 2.0.4. the bootstrap 3.1.1 file doesn't even exist in the folder! Yes, I refreshed a thousand times and I cleared my cache and all. Still in the browser it's 3.1.1

My question is this: WHAT THE HELL IS GOING ON? AND how do I switch rails use the bootstrap file in the stylesheet folder? It's as if 3.1.1 is 'locked' in.

Things I've done:

  1. Refreshed 1000s of times, emptied cache and even checked it in multiple browsers.
  2. Did the whole removed them from the Gemfile and did
destroy simple_form:install
bundle install

This resulted in my server not running for whatever reason.Like I know what I'm doing which is why I'm taking this course.

  1. Added "bootstrap-sass", "2.3.2" to my Gemfile which did absolutely nothing.
  2. Does it by any chance having to do anything with the command line thing
generate simple_form:install --bootstrap

How can I get rails to NOT use 3.1.1 which no longer even exists in the bloody folder!?!

1 Answer

Man, I am the s#@t!

As many have done, I reverted back to using the versions of software used in the video. Tinkering around and pulling out my hair I found the solution.....

Ready???

Wait, so just in a nutshell the problem

Problem: Even though I reverted back to the older versions, I mistakeningly didn't for bootstrap. I had bootstrap 3.1.1 instead of 2.0.4. So, I replaced it with the correct one. Now, unfortunately it didn't change the situation. The result was exactly the same. Form-horizontal wasn't working.

Open up dev tools for Chrome. Look at the

 <head>

and click on

<link href="/assets/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css">

and it will open up the bootstrap.css. Look at the top of the file and what version of bootstrap it is. Even though I had replaced bootstrap 3.1.1 with bootstrap 2.0.4, the version in the browser was 3.1.1. How is it physically possible if 3.1.1 doesn't even exist in the assets/stylesheets folder?

Was my laptop posessed?

Solution:

>rake assets:clean

The mods are going to have to explain it but it worked. A 1-step solution to this problem that has plagued so many of us newbies for this course.