Skip to content

Commit

Permalink
Updated documentation to reflect recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kpumuk committed Jun 8, 2018
1 parent e86b530 commit bd602f6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## 2.10.0 (June 8, 2018) [](https://github.com/kpumuk/meta-tags/compare/v2.9.0...v2.10.0)

Features:
- Allow `MetaTagsCollection#update` to receive an object ([169](https://github.com/kpumuk/meta-tags/pull/169))

## 2.9.0 (March 29, 2018) [](https://github.com/kpumuk/meta-tags/compare/v2.8.0...v2.9.0)

Features:
Expand Down
16 changes: 16 additions & 0 deletions README.md
Expand Up @@ -119,6 +119,22 @@ Also there is `set_meta_tags` method exists:
keywords: 'Site, Login, Members' %>
```

You can pass an object that implements `#to_meta_tags` method and returns a Hash:

```ruby
class Document < ApplicationRecord
def to_meta_tags
{
title: title,
description: summary,
}
end
end

@document = Document.first
set_meta_tags @document
```

The `title` method returns title itself, so you can use it to show the title
somewhere on the page:

Expand Down

0 comments on commit bd602f6

Please sign in to comment.