OG Pilot
Rails guide

OG Image Generator for Ruby on Rails

Use og_pilot_ruby in controllers/views to generate branded og:image URLs for each page request.

1

Install og_pilot_ruby

Add the gem, run bundle install, and configure credentials in environment variables.

2

Generate URLs in controllers

Call OgPilotRuby helpers with per-page data like title, description, and request path.

3

Output meta tags in layout

Set og:image and twitter:image to the generated OG Pilot URL.

4

Verify live previews

Use social debugger tools to confirm your new image is being fetched.

Ruby on Rails

Controller + meta tag integration

# Gemfile
gem "og_pilot_ruby", "~> 0.3.0"

# 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 %>" />

Common questions

Do I need a custom JWT service object?

No. Use og_pilot_ruby directly where you generate meta tags.

Can I include request.fullpath for analytics context?

Yes. Include path in the payload to track and cache per-page image usage.

Ship branded previews for every URL

OG Pilot turns page metadata into consistent, high-quality social previews without manual design exports.