shadow11 / acts_as_seo forked from azisaka/acts_as_seo
- Source
- Commits
- Network (3)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
Bruno Azisaka Maciel (author)
Sat Dec 06 21:57:32 -0800 2008
| name | age | message | |
|---|---|---|---|
| |
README.mkdn | Fri Nov 21 19:30:44 -0800 2008 | |
| |
db/ | Sat Dec 06 21:50:39 -0800 2008 | |
| |
init.rb | Wed Nov 19 14:03:01 -0800 2008 | |
| |
install.rb | Wed Nov 19 13:19:30 -0800 2008 | |
| |
lib/ | Sat Dec 06 21:50:39 -0800 2008 | |
| |
test/ | Sat Dec 06 21:50:39 -0800 2008 | |
| |
uninstall.rb | Fri Nov 14 11:33:02 -0800 2008 |
README.mkdn
Acts as SEO
The Acts the SEO is a plugin created to facilitate the management of Meta Tags.
Installing
Plugin
To install the plugin run on root folder of your application:
script/plugin install git://github.com/dookie/acts_as_seo.git
This process will create a new migration create_seo_estructure.rb on db/migrate.
So execute rake db:migrate to create the table metatags in your data base.
ActiveRecord
Open the model that you want to add the acts_as_seo and add act_as_seo there, with the example:
class Page < ActiveRecord::Base
acts_as_seo
end
ActionView
To manage your tags add these fields in your forms:
<p>
<%= f.label :metatag_title %>
<%= f.metatag_title %>
</p>
<p>
<%= f.label :metatag_keywords %>
<%= f.metatag_keywords %>
</p>
<p>
<%= f.label :metatag_description %>
<%= f.metatag_description %>
</p>
This will generate the following HTML:
<p>
<label for="page_metatag_title">Metatag title</label>
<input id="page_metatag_title" name="page[metatag_title]" size="30" type="text" />
</p>
<p>
<label for="page_metatag_keywords">Metatag keywords</label>
<input id="page_metatag_keywords" name="page[metatag_keywords]" size="30" type="text" />
</p>
<p>
<label for="page_metatag_description">Metatag description</label>
<textarea cols="40" id="page_metatag_description" name="page[metatag_description]" rows="20"></textarea>
</p>
In your views do:
