progressions-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-26 00:42 UTC
Removing tags with acts_as_taggable plugin?
How do you remove tags using the acts_as_taggable plugin? Jeff --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''m adapting the acts_as_taggable plugin and it strikes me as odd that nobody seems to have ever dealt with the fact that it doesn''t include a means to remove tags. It''s recommended in the Rails Recipes book and I''ve seen other posters on the mailing list and Rails Wiki recommending it, but hasn''t anybody ever wanted to remove a tag? I''m just learning more about polymorphic associations, so I''m sure it will be clear once I understand them more, but for now I am having trouble working out how to do a few things: 1. remove a specific tag from an object 2. determine if an object includes a tag named X 3. make sure all the tags on my object are unique, that it doesn''t have duplicated tag names Any pointers? Thanks! Jeff -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
jamiequint-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-26 08:25 UTC
Re: Removing tags with acts_as_taggable plugin?
1. haven''t implemented that so I can''t tell you 2. mytaggedobject.tags.find_by_name(tagiamlookingfor) 3. you''ll have to add this yourself in acts_as_taggable.rb, using uniq to filter the list passed in by the user should work I think. Good Luck! On Jan 25, 6:28 pm, Jeff Coleman <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''m adapting the acts_as_taggable plugin and it strikes me as odd that > nobody seems to have ever dealt with the fact that it doesn''t include a > means to remove tags. It''s recommended in the Rails Recipes book and > I''ve seen other posters on the mailing list and Rails Wiki recommending > it, but hasn''t anybody ever wanted to remove a tag? > > I''m just learning more about polymorphic associations, so I''m sure it > will be clear once I understand them more, but for now I am having > trouble working out how to do a few things: > > 1. remove a specific tag from an object > 2. determine if an object includes a tag named X > 3. make sure all the tags on my object are unique, that it doesn''t have > duplicated tag names > > Any pointers? > Thanks! > > Jeff > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
My acts_as_taggable_on_steroids plugin may be of use. I added the uniqueness checking for tag names just today, what good timing ;). http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_steroids -Jonathan. On 1/26/07, Jeff Coleman <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > > I''m adapting the acts_as_taggable plugin and it strikes me as odd that > nobody seems to have ever dealt with the fact that it doesn''t include a > means to remove tags. It''s recommended in the Rails Recipes book and > I''ve seen other posters on the mailing list and Rails Wiki recommending > it, but hasn''t anybody ever wanted to remove a tag? > > I''m just learning more about polymorphic associations, so I''m sure it > will be clear once I understand them more, but for now I am having > trouble working out how to do a few things: > > 1. remove a specific tag from an object > 2. determine if an object includes a tag named X > 3. make sure all the tags on my object are unique, that it doesn''t have > duplicated tag names > > Any pointers? > Thanks! > > Jeff > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---