Module: SimpleTags::Taggable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/simple_tags/taggable.rb
Instance Method Summary collapse
-
#tag_list ⇒ Object
Public: Return a comma-separated list of this model tags name.
-
#tag_list=(names) ⇒ Object
Public: Sets the model tags ‘names` must be a list of tag names, separated by commas.
Instance Method Details
#tag_list ⇒ Object
Public: Return a comma-separated list of this model tags name
29 30 31 |
# File 'lib/simple_tags/taggable.rb', line 29 def tag_list .map(&:name).join(", ") end |
#tag_list=(names) ⇒ Object
Public: Sets the model tags ‘names` must be a list of tag names, separated by commas
36 37 38 39 40 |
# File 'lib/simple_tags/taggable.rb', line 36 def tag_list=(names) self. = names.split(",").map do |n| SimpleTags::Tag.where(name: n.strip).first_or_create! end end |