Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

Alexander Glevsky
Alexander Glevsky
2,774 Points

Simple form, bootstrap 3 and Project Files with no css applied

Hi,

I've spent some time trying to figure out the way to apply Bootstrap 3 styles to the form but failed. Moreover, I messed the things up and now my version doesn't work at all and the one previously uploaded to GitHub by some reason doesn't start too. Totally exhausted I decided to use Project Files attached as I really want to keep moving along with the project but the strange thing is that it looks like no css is applied to the pages. I watched Installing Bootstrap part once again but everything looks the same.

So my question is "What am I doing wrong having pages with no css applied using the Project Files?" Here what I do: ā€“ download Project Files either from Stage 9 or from Stage 4, ā€“ delete everything from my Treebook folder and put files from the archive there, ā€“ run bundle install, rake db:migrate and rails s in Terminal being in the Treebook folder ā€“ get page looking like having no css at all.

I would really appreciate any help and I feel very sad being unable to go further(

3 Answers

It may be a bit late but anyhow. I had the exact problem.

Use the project files' assets folder. Copy and paste the to your assets folder. Note the project file's bootstrap is 2.0.4. If you open the bootstrap file with sublime or whatever you'll see at the top it says bootstrap 2.0.4.

Great. Now run your server and go to your site. Open up dev tools (I used chrome). In the dev tools window expand the head tag so you can see the links to your js and CSS files. Click on the link for your bootstrap.css. This will open up bootstrap.css in dev tools. Look at the top and look to see what version of bootstrap it is. If its not 2.0.4 like the one in your assets folder then shutdown server. Type in

rake assets:clean

Rerun server and go to your site and see if the proper styling has been applied. Why does this happen? I have no idea. I'm new at this too.

For whatever reason rails locks in the assets files. Bloody weird. You'll notice it's not just bootstrap but even the other CSS and js files too.

Here is original post solution https://teamtreehouse.com/forum/navbar-and-formhorizontal-not-working-like-everyone-else-but-theres-a-catch-i-found

But, if I would use the newest version of bootstrap? I do not understand why my simple_forms are not using the bootstrap css. It should be using the form-control style :x

did you check whether the bootstrap version in your browser's dev tools is the same as in your directory? They can be different