Book Image

Bootstrap for Rails

By : Syed F Rahman
Book Image

Bootstrap for Rails

By: Syed F Rahman

Overview of this book

Table of Contents (18 chapters)
Bootstrap for Rails
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a navigation bar to the Rails application


We will add the preceding navigation bar to our application. We will place our shop's branding in it and also place some links to our company pages. We will also use a black color navigation bar here and make it stick to the top of the browser window.

Go to App | Views | Layout and open the application.html.erb file. We will place the navigation bar here, since this will be globally visible throughout the website. Place the following markup above the .container element in this file:

  <div class="navbar navbar-inverted navbar-fixed-top">
    <div class="container-fluid">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#collapibleMenu">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a href=...