Forum: Ruby on Rails Newbie question about acts_as_taggable

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Frank (Guest)
on 2006-04-03 06:33
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:in
`method_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:in
`transaction'
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:in
`tag_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.
Frank (Guest)
on 2006-04-03 06:43
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?
Frank (Guest)
on 2006-04-03 06:45
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?
Bryan Buecking (Guest)
on 2006-04-03 08:39
(Received via mailing list)
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 (Guest)
on 2006-04-03 08:56
I got my work using
http://wiki.rubyonrails.org/rails/pages/ActsAsTagg...


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
Vincent AE Scott (Guest)
on 2006-04-03 19:43
(Received via mailing list)
#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 /* removed_email_address@domain.invalid */

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 topic is locked and can not be replied to.