An Administrate field for supporting ActsAsTaggableOn.
Add this line to your application's Gemfile:
gem 'administrate-field-acts_as_taggable'
Then, in your dashboard, configure your ActsAsTaggable
attribute with Field::ActsAsTaggable
:
# models/post.rb
class Post < ActiveRecord::Base
acts_as_taggable_on :categories
end
# dashboards/post_dashboard.rb
class PostDashboard < Administrate::BaseDashboard
# ATTRIBUTE_TYPES
ATTRIBUTE_TYPES = {
name: Field::String,
content: Field::Text,
categories: Field::ActsAsTaggable
}.freeze
end
Run rspec
to run the tests.
To generate documentation run yard
. To view undocumented files run yard stats --list-undoc
.
Bug reports and pull requests are welcome on GitHub at https://github.com/apsislabs/administrate-field-acts_as_taggable.
The gem is available as open source under the terms of the MIT License.
Administrate::Field::ActsAsTaggable
was built by Apsis Labs. We love sharing what we build! Check out our other libraries on Github, and if you like our work you can hire us to build your vision.