High Voltage: the setup snippet pins 5.0.0, the newest tag is v4.0.0
Easily include static pages in your Rails app.
At a glance
- What is it?
- High Voltage is a thoughtbot Rails engine that turns files in app/views/pages into routes, with a home page option, a root route drawer, a page_ids list for sitemaps and a documented override path. The installation snippet pins the 5.0 series while the newest release tag is v4.0.0 from May 2024, and commits have continued on the default branch since without a new tag.
- Who is it for?
- High Voltage is a small engine with a clear shape, and it suits applications that only need a folder of views turned into routes. Read the installation snippet with care, because pinning 5.0.0 against a repository whose newest tag is v4.0.0 will fail in a bundle install.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 45 days ago.
- What is it written in?
- Mainly Ruby, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- thoughtbot/high_voltage3,227 ★ · -7
| Repository | 2026-09-24 | 2026-11-15 |
|---|---|---|
| thoughtbot/high_voltage | 3.2k | 3.2k |
-7 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The setup snippet pins 5.0.0 while the newest tag is v4.0.0
The installation section offers two routes, and they do not agree on a version. One is the gem command. The other is a line to paste into a Gemfile:
gem 'high_voltage', '~> 5.0.0'That constraint asks for the 5.0 series. The release list stops at v4.0.0, published 2024-05-31, preceded by 4.0.0.rc1 in March 2024 and v3.1.2 in May 2019. So the snippet written into the setup instructions points at a series with no release in this repository, while the gem command beside it resolves to whatever the index currently serves rather than to the version the snippet names.
This is the first mismatch a reader runs into, and it arrives before any configuration. The pessimistic operator in that line allows any 5.x release and nothing below it, so no version of the snippet also matches v4.0.0. The tag history also shows the spacing: five years between v3.1.2 and the 4.0 line, then one release candidate followed by a single stable tag.
Commits continue on the default branch, tags stopped in May 2024
The project states that it is in maintenance mode, with no new features being added, while promising bug fixes and compatibility with current Ruby and Rails releases. The push history supports the first half of that statement and complicates the second.
The last push on the default branch is dated 2026-10-01. The newest release tag is v4.0.0 from 2024-05-31. Between those two dates there is code movement with no version attached to it.
The tree does carry the pieces a compatibility claim would be checked against: Appraisals, a gemfiles/ directory, Gemfile.lock, a Rakefile and a spec/ directory, alongside CODEOWNERS, SECURITY.md, CONTRIBUTING.md and a CHANGELOG.md. A test matrix can therefore move against newer Rails releases while the published tag stays where it landed in 2024. The license file is named MIT-LICENSE rather than LICENSE.
Setting home_page also creates a 301 from /home to /
The home page option has a documented side effect. In an initializer:
# config/initializers/high_voltage.rb
HighVoltage.configure do |config|
config.home_page = 'home'
endThat renders app/views/pages/home.html.erb when the root route is requested, and it also sets up a search engine friendly 301 redirect, so any attempt to reach /home is redirected to /. The page id home ends up with two paths pointing at it, one of which is permanently redirected to the other.
The override path further down handles the same case differently. It switches the engine routes off and writes a root route to a controller of your own, which renders the same file and says nothing about /home. A reader who rebuilds routing through the override has to decide separately whether that redirect should exist.
The override recipe redraws the routes the engine already drew
Switching the engine off and declaring the routes yourself is the documented path for four situations: authentication around pages, different layouts per page, rendering a partial out of the pages directory, and supplying a different resource. It takes three steps: generate a controller, set routes to false, then write the route.
# config/initializers/high_voltage.rb
HighVoltage.configure do |config|
config.routes = false
end# config/routes.rb
get "/pages/*id" => 'pages#show', as: :page, format: false
# if routing the root path, update for your controller
root to: 'pages#show', id: 'home'The engine default is described as /pages/:id with :id set to the view filename, which is a single segment. The replacement uses a glob, /pages/*id, and that is what lets the nesting example resolve, where one page_path argument carries about/corporate/policies/HR/en_US/biz/sales/Quarter-Four through six directory levels. format: false drops the format segment from the pattern.
The :as value is the trap the docs call out. Naming a route :page collides with the page_path method High Voltage generates, so the override reuses as: :page only because the engine routes were switched off first.
Two settings move the pages segment, one renames it and one deletes it
The default pairing is a path above a folder: url.com/pages/contact over app/views/pages. Three separate switches touch a page, and no single one of them changes more than one of those things.
The first pair is the URL. content_path renames the shared segment in both the route and the folder:
# config/initializers/high_voltage.rb
HighVoltage.configure do |config|
config.content_path = 'site/'
endroute_drawer does something different again. Set to HighVoltage::RouteDrawers::Root, it removes pages from the URL entirely, so pages are served at http://www.example.com/about and http://www.example.com/company while the files being looked for are still app/views/pages/about.html.erb and app/views/pages/company.html.erb. One setting renames the segment, the other deletes it, and both leave the view folder named the way the documentation defined it. A related setting, parent_engine, names the engine the default routes are defined on when an application runs several of them.
The second switch is the layout. One layout for every page is an initializer setting, config.layout = 'your_layout'. Per-page layouts are the other documented route, and the override example picks one with a case statement on params[:id], so the file name decides the wrapper. The initializer is the cheaper route when every page wants the same frame.
The third switch is the title. No title is derived from the file name, so the suggested mechanism is content_for on the page and yield in the layout: `<% content_for :page_title, 'About Us - Custom page title' %>` inside app/views/pages/about.html.erb, then `<title><%= yield(:page_title) %></title>` in app/views/layouts/application.html.erb. Meta-data travels the same channel.
Authentication is the first reason to override, and caching was removed outright
Requiring a signed-in user is the first item on the list of reasons to override, and the mechanism offered for it is a guard in a controller of your own:
# app/controllers/pages_controller.rb
class PagesController < ApplicationController
include HighVoltage::StaticPage
before_action :authenticate
layout :layout_for_page
private
def layout_for_page
case params[:id]
when 'home'
'home'
else
'application'
end
end
endThe include carries the finding and rendering behaviour across; the guard is yours to write. Caching moved the other way. Built in caching support was removed rather than deprecated, and page caching and action caching are now left to Rails, reached by overriding the HighVoltage controller the same way.
There is a third route recipe in that section, for keeping an existing Page resource of your own and using a StaticPage resource for these pages instead. With routing switched off:
get "/static_pages/*id" => 'high_voltage/pages#show', as: :static_page, format: falseThe engine's own controller is still the target, but both the mounted path and the generated helper change, so static_page_path sits alongside page_path rather than replacing it.
So the engine supplies lookup and layout selection, and nothing more: no access control and no caching of its own. A file dropped into app/views/pages is served at its matching path until the guard is added, which makes that folder the place to audit before a site goes live.
page_ids returns view filenames, not URLs
The one enumeration the engine offers is HighVoltage.page_ids, and the documented use is a sitemap, with sitemap_generator named as the gem to feed:
HighVoltage.page_ids.each do |page|
add page, changefreq: 'monthly'
endWhat comes back are ids, not URLs: the same values passed to page_path and the same :id the generated routes match, which the routing section defines as the view filename. The list is therefore derived from what sits in app/views/pages, and any sitemap built from it inherits whatever URL shape the active route drawer produces.
Adding a file to the folder grows the list and removing one shrinks it. Nothing in the documented call enumerates layout, front matter or per-page metadata, so every entry lands in a sitemap with the same changefreq value.
The page finder example ends two characters into its first method
The last extension point named is the lookup itself, reached by overriding page_finder_factory in a controller. The worked example returns a class named Rot13PageFinder, subclassed from HighVoltage::PageFinder, which is described as providing page_id. That example opens def find and the document stops there, two characters into the method body, before showing what a finder returns or how page_id reaches the render.
So the hook is named, the base class is named, and the contract between the two is left open. Anyone extending lookup has to read the gem source for PageFinder rather than the documentation, which is a reasonable thing to do for a project in maintenance mode but worth knowing before you build on it.
Editorial conclusion
High Voltage is a small engine with a clear shape, and it suits applications that only need a folder of views turned into routes. Read the installation snippet with care, because pinning 5.0.0 against a repository whose newest tag is v4.0.0 will fail in a bundle install. Before putting a site on it, check the Ruby and Rails versions your application runs, add the authentication guard the engine does not provide, and decide whether the /home redirect and the pages URL segment are what you actually want. For custom page lookup the documentation names the hook but does not finish the example, so plan on reading lib/ instead.
Frequently asked questions
How do I install High Voltage into a Rails application?
Either run gem install high_voltage, or add the line gem 'high_voltage', '~> 5.0.0' to the Gemfile. That constraint names the 5.0 series, while the newest release tag is v4.0.0 from 2024-05-31.
Where do I put a static page in High Voltage?
In RAILS_ROOT/app/views/pages, created with mkdir app/views/pages and touch app/views/pages/about.html.erb, then linked from anywhere with page_path('about'). Directories nest, so page_path('about/corporate/policies/HR/en_US/biz/sales/Quarter-Four') resolves a deep path.
Does High Voltage put authentication in front of static pages?
No. Requiring a signed-in user is the first listed reason to override the engine, which is done by including HighVoltage::StaticPage in a controller of your own and adding a before_action :authenticate to it.
Can High Voltage serve a page at the site root?
Yes, by setting config.home_page = 'home' in an initializer, which renders app/views/pages/home.html.erb for the root route and adds a search engine friendly 301 redirect from /home to /.
Does High Voltage still cache its pages?
Built in caching support was removed. Page caching and action caching are left to Rails, and the documented way to reach them is overriding the HighVoltage controller.
How do I list every static page High Voltage knows about?
Call HighVoltage.page_ids, which returns the page ids rather than URLs. The worked example feeds that list to the sitemap_generator gem, adding each id with changefreq: 'monthly'.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/thoughtbot-high-voltage)Star history chart for your README
[](https://hysenlabs.com/projects/thoughtbot-high-voltage)Was this useful?