Install og_pilot_ruby
Add the gem, run bundle install, and configure credentials in environment variables.
Use og_pilot_ruby in controllers/views to generate branded og:image URLs for each page request.
Choosing between a static file, drawing the card yourself into Active Storage, and caching an OG Pilot image on the record? Read the Rails OG image comparison.
Add the gem, run bundle install, and configure credentials in environment variables.
Call OgPilotRuby helpers with per-page data like title, description, and request path.
Set og:image and twitter:image to the generated OG Pilot URL.
Use social debugger tools to confirm your new image is being fetched.
# Gemfile
gem "og_pilot_ruby", "~> 0.4.1"
# app/controllers/posts_controller.rb
class PostsController < ApplicationController
def show
@post = Post.find(params[:id])
@og_image = OgPilotRuby.create_image(
template: "blog_post",
title: @post.title,
description: @post.excerpt,
image_url: @post.cover_url,
path: request.fullpath,
iat: Time.current.to_i
)
end
end
# app/views/layouts/application.html.erb
<meta property="og:image" content="<%= @og_image %>" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="<%= @og_image %>" />No. Use og_pilot_ruby directly where you generate meta tags.
Yes. Include path in the payload to track and cache per-page image usage.
OG Pilot turns page metadata into consistent, high-quality social previews without manual design exports.