gutentag icon indicating copy to clipboard operation
gutentag copied to clipboard

Can't get list of tags for a given class

Open activestylus opened this issue 3 years ago • 1 comments

I'm unable to get an array of tags scoped by model as specified by the README:

In my model:

  Gutentag::ActiveRecord.call self
  def tags_as_string
    tag_names.join(", ")
  end
  def tags_as_string=(string)
    self.tag_names = string.split(/,\s*/)
  end

In my view: Gutentag::Tag.names_for_scope(MyClassName)

Resulting Error:

undefined method names_for_scope' for #Class:0x00007fbf91d1df28`

activestylus avatar Oct 22 '22 11:10 activestylus

I'm at a bit of a loss as to why this isn't working - but, I guess a starting point: are you using v2.5.0 or newer? As that's when the names_for_scope method was added.

pat avatar Oct 30 '22 03:10 pat