Module: ActsAsTaggableOn::Taggable

Defined in:
lib/acts_as_taggable_on/taggable.rb,
lib/acts_as_taggable_on/taggable/core.rb,
lib/acts_as_taggable_on/taggable/cache.rb,
lib/acts_as_taggable_on/taggable/related.rb,
lib/acts_as_taggable_on/taggable/ownership.rb,
lib/acts_as_taggable_on/taggable/collection.rb,
lib/acts_as_taggable_on/taggable/tag_list_type.rb

Defined Under Namespace

Modules: Cache, Collection, Core, Ownership, Related, TaggedWithQuery Classes: TagListType

Instance Method Summary collapse

Instance Method Details

#acts_as_ordered_taggableObject

This is an alias for calling acts_as_ordered_taggable_on :tags.

Example:

class Book < ActiveRecord::Base
  acts_as_ordered_taggable
end


26
27
28
# File 'lib/acts_as_taggable_on/taggable.rb', line 26

def acts_as_ordered_taggable
  acts_as_ordered_taggable_on :tags
end

#acts_as_ordered_taggable_on(*tag_types) ⇒ Object

Make a model taggable on specified contexts and preserves the order in which tags are created

Example:

class User < ActiveRecord::Base
  acts_as_ordered_taggable_on :languages, :skills
end

Parameters:

  • tag_types (Array)

    An array of taggable contexts



53
54
55
# File 'lib/acts_as_taggable_on/taggable.rb', line 53

def acts_as_ordered_taggable_on(*tag_types)
  taggable_on(true, tag_types)
end

#acts_as_taggableObject

This is an alias for calling acts_as_taggable_on :tags.

Example:

class Book < ActiveRecord::Base
  acts_as_taggable
end


15
16
17
# File 'lib/acts_as_taggable_on/taggable.rb', line 15

def acts_as_taggable
  acts_as_taggable_on :tags
end

#acts_as_taggable_on(*tag_types) ⇒ Object

Make a model taggable on specified contexts.

Example:

class User < ActiveRecord::Base
  acts_as_taggable_on :languages, :skills
end

Parameters:

  • tag_types (Array)

    An array of taggable contexts



39
40
41
# File 'lib/acts_as_taggable_on/taggable.rb', line 39

def acts_as_taggable_on(*tag_types)
  taggable_on(false, tag_types)
end

#taggable?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/acts_as_taggable_on/taggable.rb', line 4

def taggable?
  false
end