Skip to content

Commit

Permalink
updated install guide
Browse files Browse the repository at this point in the history
  • Loading branch information
ashchan committed Jun 25, 2008
1 parent b96c9ba commit 0870b82
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions README
Expand Up @@ -7,31 +7,36 @@ It is a very simple plugin to help you customize your pages' meta tags a little

How to Install
======
./script/plugin install git://github.com/ashchan/meta_on_rails.git
For Rails 2.1 or later:

./script/plugin install git://github.com/ashchan/meta_on_rails.git

Otherwise:

git clone git://github.com/ashchan/meta_on_rails.git vendor/plugins/meta_on_rails

Example
=======
Add the following code to the layout (e.g. app/views/layout/application.html.erb), be sure to put it in the head tag:

<head>
<%= display_meta(:keywords => "default,keywords", :description => "default description") %>
</head>
<head>
<%= display_meta(:keywords => "default,keywords", :description => "default description") %>
</head>

Default meta values can be set. In the above example, these two meta tags will be generated if they're not override on the views:
Default meta values can be set. In the above example, these two meta tags will be generated if they're not overriden on the views:

<meta name="description" content="default description" />
<meta name="keywords" content="default,keywords" />
<meta name="description" content="default description" />
<meta name="keywords" content="default,keywords" />

Then add this code to the view to set meta tags on that page:

<% set_meta(:keywords => 'my,keyword', :generator => 'a bad <script /> generator') %>
<% set_meta(:keywords => 'my,keyword', :generator => 'a bad <script /> generator') %>

The output html will be like this:

<meta name="generator" content="a bad generator" />
<meta name="description" content="default description" />
<meta name="keywords" content="my,keyword" />
<meta name="generator" content="a bad generator" />
<meta name="description" content="default description" />
<meta name="keywords" content="my,keyword" />


=======
Expand Down

0 comments on commit 0870b82

Please sign in to comment.