Skip to content

Instantly share code, notes, and snippets.

Scott Rocher rochers

View GitHub Profile
nicolasblanco / gist:1069378
Created Jul 7, 2011
Rails i18n framework for your meta tags
View gist:1069378

Rails i18n framework for your meta tags

Here is a convenient method for page titles and other meta tags.

One common solution is to use "yield" and some kind of helpers that would call content_for (like in this Railscasts).

The problem is that for Search Engines Optimization, you should change all your meta tags for every page to avoid duplicate content, and call your helpers on every page...

This workaround uses the i18n framework and tries to find the good tags depending on the page you are, so you don't have to call any helper by default.

You can’t perform that action at this time.