Module: Metatags
- Defined in:
- lib/metatags/base_metatags.rb,
lib/metatags.rb,
lib/metatags/engine.rb,
lib/metatags/version.rb,
lib/metatags/concerns/controller.rb
Overview
Example:
class ApplicationController < ActionController::Base
include Metatags::Concerns::Controller
end
class ArticlesController < ApplicationController
before_action :find_article, only: [:show]
# Simplest option.
# Will use Metatags::ArticleMetatags by default.
instance: :article
# OR
# if you need to be specific about which class to use
with: Metatags::CustomArticleMetatags, instance: :article
# OR
# if you need logic to determine which Metatags class to use, and want to build
# the meta tags in the action itself.
only: [:index]
def index
@articles = Article.all
end
def show
end
protected
def find_article
@article = Article.find(params[:id])
end
end
Defined Under Namespace
Modules: Concerns Classes: BaseMetatags, Engine
Constant Summary collapse
- VERSION =
"0.0.1"