Routing for High Voltage Gem

The High Voltage gem provides a PagesController. You’ll never see it; it
is packaged inside the gem.

In addition to providing a controller, the High Voltage gem provides
default routing so any URL with the form
http://localhost:3000/pages/about will obtain a view from the
app/views/pages directory.

Like the PagesController, the code that sets up the route is packaged
inside the gem. For details about the syntax of routing directives,
refer to RailsGuides: Routing from the Outside In.
Update the Navigation Partial

You can use a Rails route helper to create a link to any view in the
app/views/pages directory like this:

link_to 'About', page_path('about')

Let’s add links to the “About” and “Contact” pages.

Replace the contents of the file
app/views/layouts/_navigation_links.html.erb with this:

<%# add navigation links to this file %>
<li><%= link_to 'About', page_path('about') %></li>
<li><%= link_to 'Contact', page_path('contact') %></li>

With an updated navigation bar, we can test the application.