Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
Creating a Jumbotron and Buttons with Bootstrap.docx58.8 KB Creating a Jumbotron and Buttons with Bootstrap - Solution.docx
59.3 KB
Quick reference
Creating a Jumbotron and Buttons with Bootstrap
In this video we'll create a Bootstrap Jumbotron for our site and add some fancy buttons too.
When to use
Anytime you want to add a little visual element to your app, you can look through Bootstrap for some example code to use.
Instructions
First, let's create a jumbotron partial that we can call at will. Name it _jumbotron.html.erb and save it in the app/views/home directory.
Next, head over to GetBootstrap.com, click the components link, and then the jumbotron link to find the code for a jumbotron.
Click the copy link to copy the code, then paste it into your jumbotron partial file.
Modify the code to make the jumbotron say whatever you want it to say.
Finally, render the partial on your index page using the <%= render 'home/jumbotron' %> embedded ruby command.
Follow the same steps to add some Bootstrap buttons to your index page.
Hints & tips
- Find the JumboTron at GetBootstrap.com
- Copy and Paste the code
- Modify the code to say whatever you like
- Render Your Partial
Lesson notes are only available for subscribers.