Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
a simple rails controller that implements meta tags
class HomeController < ApplicationController
def index
@page_title = "Your Page Title Here"
@page_description = "Your Page Description Here"
@page_keywords = "comma, separated, keywords, here"
set_meta_tags(
og: {
image: 'your::aws::s3:image_path',
title: @page_title,
description: @page_description
},
twitter: {
image: {
_: 'your::aws::s3:image_path',
width: 1200,
height: 628,
},
card: 'summary_large_image',
}
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment