Sajad
Sajad

Reputation: 153

Bootstrap CSS doesn't display in rails project

I've downloaded the project files from the Treehouse Rails Developer course. Rails Development adventure, Stage 4 : Using AJAX. I managed to get the app working but my bootstrap styling does not display.

The bootstrap files are all in their respective folders.

Here's some code from my application.css :

*= require_self
*= require_tree

body {
padding-top: 40px;
}

.alert {
margin-top: 10px;
}

My application.html.erb does contain the stylesheet link tag :

<%= stylesheet_link_tag "application", :media => "all" %>

I'm running rails v 3.2.6 on OSX Mavericks

Thanks ahead of time for the assistance

Upvotes: 0

Views: 384

Answers (2)

Sajad
Sajad

Reputation: 153

I've figured it out :

  1. set config.assets.initialize_on_precompile = true in application.rb
  2. flush the asset pipeline cache by running rake tmp:cache:clear

Upvotes: 1

samkpower
samkpower

Reputation: 91

Your application.css file should like this:

*= require_self
*= require_tree .

body {
padding-top: 40px;
}

.alert {
margin-top: 10px;
}

The period is important - it means grab all of the stylesheets in the current directory.

Upvotes: 2

Related Questions