
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Collection of view helpers to improve search engine optimization of Ruby on Rails application.
SEO Rails Helpers requires Ruby version >=1.9.3 and Rails >= 3.2
Add this line to your Rails application's Gemfile:
gem 'seo_rails_helpers'
And then execute bundle
command to install.
This helper will produce SEO friendly page title. It assumes you are using either content_for
or provide
helper in your page view to store page title.
Include seo_page_title
in the <head>
section of your layout
ERB example:
<head>
<%= seo_page_title %>
<%# other elements %>
</head>
Haml example:
%head
seo_page_title
-# other elements
This will create HTML title element:
<title>Page Title | Base Title</title>
Exact format of title element will vary based on user-specific options.
Name | Description | Default |
---|---|---|
:page_title | Identifier for stored page title. Specify symbol representing identifier in your provide or content_for method. | :title |
:separator | Character that separates :page_title and :base_title | | |
:base_title | Base title, like your brand or app name. In case :page_title is missing or empty the title will consist of :base_title only. | Your Rails application name |
provide(:page_title, 'Example Page')
seo_page_title(page_title: :page_title,
separator: '>',
base_title: 'Example Site')
Will produce following title element:
<title>Example Page > Example Site</title>
This helper will create and insert meta element to specify description. Unlike seo_page_title
, it produces meta description only when corresponding page explicitly sent it via either content_for
or provide
. Reason for such behavior - having any kind of default meta description is considered a bad SEO practice and may result in search engine ranking penalty.
Include seo_meta_description
in the <head>
section of your layout
ERB example:
<head>
<%= seo_meta_description %>
<%# other elements %>
</head>
Haml example:
%head
seo_meta_description
-# other elements
This will create HTML title element like:
<meta name="description" content="Example meta description" />
Name | Description | Default |
---|---|---|
:description | Identifier for stored meta description. Specify symbol representing identifier in your provide or content_for method. | :description |
provide(:meta_description, 'Custom meta description')
seo_meta_description(description: :meta_description)
Will produce following title element:
<meta name="description" content="Custom meta description" />
Fork the project and submit a pull request.
FAQs
Unknown package
We found that seo_rails_helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.