DefV / title_helper
- Source
- Commits
- Network (3)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
e7cf222
Mikael Hallendal (author)
Mon Jun 16 03:48:14 -0700 2008
Jan De Poorter (committer)
Mon Jun 16 03:48:14 -0700 2008
title_helper / README.rdoc
| 308dec78 » | DefV | 2008-04-17 | 1 | TitleHelper | |
| 2 | =========== | ||||
| 3 | |||||
| 4 | TitleHelper allows you to keep your <title> attributes synced with your <h1> attributes, which is more SEO friendly. This is 100% done in the view, which is different from some other plugins, who work with a title-method in the controllers. | ||||
| 5 | |||||
| 6 | Example | ||||
| 7 | ======= | ||||
| 8 | |||||
| 9 | This method should be used in your layout and your actions. | ||||
| 10 | |||||
| 11 | In your action: | ||||
| 12 | <%= title "Edit user #{@user.name}" %> | ||||
| 13 | # => <h1>Edit user Jan De Poorter</h1> | ||||
| 14 | |||||
| 15 | In your layout: | ||||
| 16 | <head> | ||||
| 17 | <title><%= title :site_name => 'Foobar' %></title> | ||||
| 18 | # => <title>Edit user Jan De Poorter - Foobar</title> | ||||
| 19 | |||||
| 20 | Copyright (c) 2008 Jan De Poorter, released under the MIT license | ||||
