OG Images for Your Rails Application

Use Rails helpers and view partials to generate perfect OG images for every page in your app.

Get Started

Rails Helper

Clean Ruby DSL with helper methods that integrate seamlessly with your views.

View Partial

Reusable partials that you can include in any layout or view template.

ERB / HAML

Works with both ERB and HAML templating engines out of the box.

Example Integration

# app/helpers/og_helper.rb
module OgHelper
  def imago_og_url(title)
    params = {
      title:    title,
      template: 'modern',
      api_key:  ENV['IMAGO_API_KEY']
    }
    "https://imagoapi.com/api/og/generate?#{params.to_query}"
  end
end
<!-- app/views/layouts/application.html.erb -->
<%= tag.meta property: 'og:image',      content: imago_og_url(@post&.title || 'My Site') %>
<%= tag.meta name:     'twitter:image', content: imago_og_url(@post&.title || 'My Site') %>

Generate Perfect OG Images Today

Join thousands of developers using Imago API for dynamic social cards.

Start Free Trial