Sha256: b54f3bbb5682b891d5e6f72fb3cddde55b36f7cf922e5c3b85ce9eb663e8e1e3

Contents?: true

Size: 841 Bytes

Versions: 1

Compression:

Stored size: 841 Bytes

Contents

## Simple gem for Tags

###Allow add Tags for any model

#####Examples:

Add `gem 'my_tags'` to Gemfile

Add `has_many_tags` for model, which you want to use tags

```
class Post < ActiveRecord::Base
has_many_tags
```

Run rake `my_tags:install:migrations` and `rake:db:migrate`

Done!

###### Done, ready for using:

post = Post.create(name: 'Post with tags')

post.tags => []

post.tags.count => 0

post.tag_list << 'First tag'

post.tags.count => 1

post.tags.first.delete

post.tags.count => 0

Or you can use this method:

`@post.process_tags('animals, pets')` or `@post.process_tags(['animals', ['pets'])` 


### UI features:

Add to Routes.rb `mount MyTags::Engine, at: "/my_tags"`


Add to your applications.js: `//= require my_tags`

Use `= tags_field_tag(@post)` helpers method in views (it draw input field with autocompete popup)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
my_tags-1.0.0 README.md