Having Trouble Using ActsAsTaggable

I’ve installed the acts_as_taggable plugin and modifed it according to
the tutorial form making it user specific
(http://www.slashdotdash.net/blog/articles/2006/04/29/acts_as_taggable-per-user-tagging
).

I keep getting errors when I try to tag things, however, and have traced
the problem to the line of the tag_with function that calls the
find_or_create_by_name function. So I fired up the console and did the
following:

Loading development environment.

Tag.find_or_create_by_name(“ruby rails”, User.find(2))
NoMethodError: undefined method find_or_create_by_name' for Tag:Class from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1123:inmethod_missing’
from (irb):1

Is this some sort of problem with my rails version? I looked in my ruby
folder and I have versions 1.0.0, 1.1.0, and 1.1.2 in the gems folder.
Is my application possibly using the wrong folder? Or do i need to
update the active record gem somehow?

If anyone has advice, please send it my way. Thanks.

I figured this one out finally. I had originally had a column in my
tags table called tag that I forgot to change to name

Looks like find_or_create_by_x is a method dynamically created according
to column names.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs