Locked lesson.
About this lesson
How to build a Bootstrap navbar?
Exercise files
Download this lesson’s related exercise files.
Creating a Navbar.docx58.8 KB Creating a Navbar - Solution.docx
59.1 KB
Quick reference
Creating a Navbar
In this video we'll create a navigation bar for our app.
When to use
Whenever you want a navbar in your app, you can use the Bootstrap navbar code from GetBootstrap.com
Instructions
Head over to GetBootstrap.com and click on the "Components" link at the top of the page.
Scroll down through the links on the right-hand side of the screen till you see the Navbar link.
Click that link to find the code to navbars. Click the "copy" button to copy the code.
Paste that code above the yield reference in your application.html.erb file so that the navbar will appear on every page of your site.
Customize the code to remove the components of the navbar that you don't want.
Add your links using embedded ruby.
Hints & tips
- Bootstrap has some nice navbar code we can copy and paste into our app
- Navbar code should go above the yield tag in our application.html.erb file
- Use embedded Ruby links in the navbar
Lesson notes are only available for subscribers.