Iteration J4: Adding a Sidebar, More Administration

Let’s start with adding links to various administration functions to the sidebar in the layout and have them show up only if a :user_id is in the session:

 <html>
  <head>
  <title>Pragprog Books Online Store</title>
 <%=​ csrf_meta_tags ​%>
 
 <%=​ stylesheet_link_tag ​'application'​, ​media: ​​'all'​,
 'data-turbolinks-track'​: ​'reload'​ ​%>
 <%=​ javascript_include_tag ​'application'​,
 'data-turbolinks-track'​: ​'reload'​ ​%>
  </head>
 
  <body>
  <header class=​"main"​>
 <%=​ image_tag ​'logo.svg'​, ​alt: ​​'The Pragmatic Bookshelf'​ ​%>
  <h1>​<%=​ @page_title ​%>​</h1>
  </header>
  <section class=​"content"​>

Get Agile Web Development with Rails 5.1 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.