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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.