Godmin Tags is a tags component for Godmin that adds an f.tags_field
to forms.
Add the gem to the application's Gemfile
:
gem "godmin-tags"
Or to the admin engine's gemspec
:
s.add_dependency "godmin-tags", "~> x.x.x"
Use the tags field in your form like so:
<%= form_for(@resource) do |f| %>
<%= f.text_field :title %>
<%= f.text_area :body %>
<%= f.tags_field :tags, data: { collection: Tag.all.pluck(:name) } %>
<% end %>
Or initialize yourself using JavaScript:
Godmin.Tags.initializeTagger($el);
Additional options can be passed down to Godmin.SelectBoxes
:
Godmin.Tags.initializeTagger($el, {
create: false
});
https://github.com/varvet/godmin-tags/graphs/contributors
Licensed under the MIT license. See the separate MIT-LICENSE file.