Ruby on Rails and Canonical link tag

On February Google, Yahoo, and Microsoft announced support for a new link element to clean up duplicate URLs on sites. The element is called Canonical Link tag and the syntax is pretty simple.

This tag, added in the HEAD section of an HTML page, tells search engines that the preferred location for the content of the request page is the value of the href attribute, in this case If you want to learn more about the canonical link tag, have a look at Matt Cutt's introductory post or Google Webmaster Central.

The new version of my Helperful Rails plugin provides a new method named canonical_link_tag, a super simple helper to generate the canonical link tag. The usage is similar to the auto_complete_link_tag helper.

# => <link rel="canonical" href=" />

canonical_link_tag(:action => "show")
# => <link rel="canonical" href=" />

# => <link rel="canonical" href="" />

You can install or upgrade Helperful via RubyGems.

$ gem install weppos-helperful --source