Newbie question about acts_as_taggable

I installed the acts_as_taggable plugin that DHH wrote.

Now I have met problems on using it:

class Book < ActiveRecord::Base
acts_as_taggable
end

mybook = Book.new
mybook.tag_with(‘red library book’)

But the system tell the wrong message:
undefined method parse' for Tag:Class d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/base.rb:1123:inmethod_missing’
#{RAILS_ROOT}/vendor/plugins/acts_as_taggable/lib/acts_as_taggable.rb:42:in
tag_with' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/connection_adapters/abstract/database_statements.rb:51:intransaction’
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/transactions.rb:91:in
transaction' #{RAILS_ROOT}/vendor/plugins/acts_as_taggable/lib/acts_as_taggable.rb:39:intag_with’

btw: it seems the api at http://taggable.rubyforge.org/ does not fit the
usage of the plugin at all,there seems to be two implementation of
acts_as_taggable.

I know the difference between the gem and plugin from
http://www.notio.com/2006/02/rails_acts_as_t.html

Since the plugin is the recommended way to use taggable,i decide to use
it,but error found,anyone has met such a situation?

btw, I am using rails 1.1 while not edge rails,i think the plugin can be
used under this kind enviroment,isn’t it?

I got my work using
http://wiki.rubyonrails.org/rails/pages/ActsAsTaggablePluginHowto

Bryan Buecking wrote:

Frank wrote:

But the system tell the wrong message:
undefined method `parse’ for Tag:Class
Have you defined a class named Tag?

Bryan Buecking

Frank wrote:

But the system tell the wrong message:
undefined method `parse’ for Tag:Class
Have you defined a class named Tag?

Bryan Buecking

#if bryan /* Apr 03, 01:37 */

mybook.tag_with(‘red library book’)

But the system tell the wrong message:
undefined method `parse’ for Tag:Class
Have you defined a class named Tag?
#endif /* [email protected] */

To clarify for any other newbies (like myself):

If you have a Tag class already defined, say for example in
app/models/tag.rb, then remove it first. You dont need to create it.

I just hit the same problem after switching over from the gem version to
the plugin one.


keys: http://codex.net/gpg.asc

Why God never received a PhD:
3. It had no references.

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