I''ve just open-sourced and released spraypaint, a tagging plugin I''ve developed. I can''t claim it''s better than all other tagging plugins out there (and there are certainly quite a few) but I think it''s different enough that other people might find it useful. Here are some of those differences: a) Most tagging queries wrap around the standard finder methods. So the following are all valid: # Finds with added conditions, limit and offsets Pub.find :all, :tagged_with_all => [''cosy'', ''wood fire'', ''real ale''], :conditions => {:city_id => ''london''}, :limit => 20, :offset => 10 # Calculations based on tags Pub.sum :turnover, :tagged_with_any => ''football'' # Finds through associations City.find_by_name(''London'').pubs.find(:all, :tagged_with_any => [''overpriced'']) b) While there is a proper tagging model hidden away, all manipulation is done through strings: p = Pub.create :tags => [''dark'', ''old men'', ''fights''] p.tags << ''wetherspoons'' p.save p.tag_string = "dark, old men, fights" p.save c) There''s some rudimentary support for machine tagging: Film.create :tags => [''film:director:coens''] Film.find :all, :tagged_with_any => {:namespace => :film} Film.find :all, :tagged_with_any => {:namespace => :film, :predicate => :director} If any of this sounds interesting, take a look at: http://svn.tomafro.net/plugins/spraypaint/trunk I''d be interested in all comments and feedback Tom --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tom Ward
2007-Nov-26 17:13 UTC
Re: ANN: Spraypaint - yet another tagging library for rails
Following some advice, I''ve moved the code to http://svn.tomafro.net/rails/plugins/spraypaint so it works nicely with script/plugin install. I''ve also backported the code to 1.2.6 as apparently not everyone develops their apps on the bleeding edge ;) I''d still really appreciate any more comments, criticism or even abuse you''d all care to send my way. Tom On 11/23/07, tomafro <tom-FF2hOUnQ1ZmsTnJN9+BGXg@public.gmane.org> wrote:> I''ve just open-sourced and released spraypaint, a tagging plugin I''ve > developed. I can''t claim it''s better than all other tagging plugins > out there (and there are certainly quite a few) but I think it''s > different enough that other people might find it useful. Here are > some of those differences: > > a) Most tagging queries wrap around the standard finder methods. So > the following are all valid: > > # Finds with added conditions, limit and offsets > Pub.find :all, :tagged_with_all => [''cosy'', ''wood fire'', ''real > ale''], :conditions => {:city_id => ''london''}, :limit => 20, :offset => > 10 > > # Calculations based on tags > Pub.sum :turnover, :tagged_with_any => ''football'' > > # Finds through associations > City.find_by_name(''London'').pubs.find(:all, :tagged_with_any => > [''overpriced'']) > > b) While there is a proper tagging model hidden away, all manipulation > is done through strings: > > p = Pub.create :tags => [''dark'', ''old men'', ''fights''] > p.tags << ''wetherspoons'' > p.save > > p.tag_string = "dark, old men, fights" > p.save > > c) There''s some rudimentary support for machine tagging: > > Film.create :tags => [''film:director:coens''] > Film.find :all, :tagged_with_any => {:namespace => :film} > Film.find :all, :tagged_with_any => {:namespace => :film, :predicate > => :director} > > If any of this sounds interesting, take a look at: > > http://svn.tomafro.net/plugins/spraypaint/trunk > > I''d be interested in all comments and feedback > > Tom > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Scott A S
2007-Nov-26 19:01 UTC
Re: ANN: Spraypaint - yet another tagging library for rails
I''ve added it to RailsLodge http://www.railslodge.com/plugins/831-spraypaint Tom Ward wrote:> Following some advice, I''ve moved the code to > http://svn.tomafro.net/rails/plugins/spraypaint so it works nicely > with script/plugin install. > > I''ve also backported the code to 1.2.6 as apparently not everyone > develops their apps on the bleeding edge ;) > > I''d still really appreciate any more comments, criticism or even abuse > you''d all care to send my way. > > Tom-- 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 -~----------~----~----~----~------~----~------~--~---