Add A Navbar
Goals
Discussion: What's an application layout?
Steps
Step 1: Add the Markup
<header class='clearfix'> <div class="left-nav"> <ul> <li><%= link_to "Home", jobs_path %></li> </ul> </div> <div class="right-nav"> <ul> <li><%= link_to "Add Job", new_job_path %></li> </ul> </div> </header><div class="content"> <%= yield %> </div>Step 2: Add the styles
html { font-size: 18px; line-height: 1.5; font-family: ui-sans-serif,sans-serif; } body { margin: 0; } .content { margin: 10px auto; width: 70%; } .clearfix { overflow: hidden; }header { background: grey; padding: 10px; ul { margin: 0; padding: 0; list-style-type: none; } a { text-decoration: none; font-weight: bold; color: white; } } .left-nav { float: left; } .right-nav { float: right; }
Now would be a good time to commit to git
Next Step:
Go on to Update Job Listings