Create an initializer for that sets up the taggable models and their controllers. This gives the models the tag
associations and methods and prepares their controller to handle the otherwise unexpected tag params.
require 'e9_tags'
require 'contacts_controller'
require 'contact'
E9Tags.controllers << ContactsController
E9Tags.models << Contact
OR
You can just include the modules in your classes yourself. The first way really exists for the case where the
classes you wish to extend are part of another plugin/gem.
# in contact.rb
include E9Tags:Model
# in contacts_controller.rb
include E9Tags::Controller
Render the tags form partial in whatever model forms require it.
= render 'e9_tags/form', :f => f
If you pass a context, it will be locked and no longer possible to change/add the contexts on the form (and as
a side effect, the tags autocompletion will be restricted to that context).
= render 'e9_tags/form', :f => f, :context => :users
Finally if you pass a 2nd arg to :context you can set a tag context to be "private" (default is false). In this
case the tag context will be locked as private (typically suffixed with *), meaning that the tags will not be
publicly searchable/visible. This is useful for organizational tags tags, say if you wanted to arbitrarily
group records, or create a custom search based on a tag context.
= render 'e9_tags/form', :f => f, :context => [:users, true]
NOTE: The form and javascript are intended to work out of the box, but the certainly aren't going to look pretty.
If you do intend to use the forms, you'll no doubt need to style them.