Search code examples
twitter-bootstrap-rails

twitter bootstrap fluid layout


I want to implement the fluid layout. Shown as here http://twitter.github.com/bootstrap/scaffolding.html#global

What i did: added gem 'twitter-bootstrap-rails + bundle install

layouts/applicationlayout

 <head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">

  </head>

<body>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<div class="container-fluid">
    <div class="row-fluid">
    <div class="span2">
     SIDEBAR
    </div>
    <div class="span10">
      <%= yield %>
    </div>
  </div>
</div>
</body>

nothing took change. What did i forget?


Solution

  • The bootstrap-responsive.css file is only part of bootstrap. The main css file you need is called bootstrap.css

    Try adding this line of code in your header and see if anything changes:

    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet">
    <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
    </head>
    

    Actually, it does work, look at the jsFiddle:

    http://jsfiddle.net/persianturtle/sEywB/