Demetrius Nunes
2005-Sep-05 20:43 UTC
[ANN] acts_as_taggable v3 - Yet better tagging for Rails!
Hello folks, There´s a brand new version of *acts_as_taggable* available at the same place as before: http://dema.ruby.com.br/articles/2005/09/03/tagging-on-steroids-with-rails It features bugfixes (thanks to Geoffrey Rosenbach and technoweenie), improved API (thanks to some nice ideas from Ronny Hanssen) and full, complete RDoc documentation: http://dema.ruby.com.br/files/doc/index.html You can now use a regular text_field helper to tag your objects very easily on HTML forms, like this: <%= text_field ''photo'', ''tag_names'' %> This thing just keeps getting better and better! ;-) Best regards, Dema -- http://dema.ruby.com.br - Rails from a .NET perspective
Ronny Hanssen
2005-Sep-05 23:15 UTC
Re: [ANN] acts_as_taggable v3 - Yet better tagging for Rails!
Hi, I have a question that isn't really *that* related to taggable, but that was how it appeared, and if I post this to the list the others might not get the context of the acts_as_taggable extension. I have the tables items and articles modeled as follows: class Item < ActiveRecord::Base acts_as_taggable end class Article < ActiveRecord::Base has_one :item end The ArticlesController class has a method, edit, like this: def edit @article = Article.find(params[:id]) @item = @article.item # shortcut to get the items ready for "easy macro form filling" if params[:article] and @article.update_attributes(params[:article]) flash[:notice] = 'Article was successfully updated.' render :action => 'show' end end When I hit the save button the item.tag isn't written. I thought that since the Article class uses: has_one :item then the item record was to be saved when the article is saved? Together with the item.tags? As it is now I have to add extra code for saving the item. Why is that? Am I doing something wrong? Ronny On 9/5/05, Demetrius Nunes <demetrius@interface-ti.com.br> wrote:> > Hello folks, > > There´s a brand new version of *acts_as_taggable* available at the same > place as before: > > http://dema.ruby.com.br/articles/2005/09/03/tagging-on-steroids-with-rails > > It features bugfixes (thanks to Geoffrey Rosenbach and technoweenie), > improved API (thanks to some nice ideas from Ronny Hanssen) and full, > complete RDoc documentation: > http://dema.ruby.com.br/files/doc/index.html > > You can now use a regular text_field helper to tag your objects very > easily on HTML forms, like this: > <%= text_field 'photo', 'tag_names' %> > > This thing just keeps getting better and better! ;-) > > Best regards, > Dema > -- > http://dema.ruby.com.br - Rails from a .NET perspective > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Pat Maddox
2005-Sep-05 23:22 UTC
Re: [ANN] acts_as_taggable v3 - Yet better tagging for Rails!
No, that''s right. It would be pretty inefficient if Rails saved the entire object tree each time you save one object. I ran into this problem a lot when I was first starting off. You have to save the article and item individually. Pat On 9/5/05, Ronny Hanssen <super.ronny-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I have a question that isn''t really *that* related to taggable, but that > was how it appeared, and if I post this to the list the others might not get > the context of the acts_as_taggable extension. > > I have the tables items and articles modeled as follows: > > class Item < ActiveRecord::Base > acts_as_taggable > end > > class Article < ActiveRecord::Base > has_one :item > end > > The ArticlesController class has a method, edit, like this: > def edit > @article = Article.find(params[:id]) > @item = @article.item # shortcut to get the items ready for "easy macro > form filling" > if params[:article] and @article.update_attributes(params[:article]) > flash[:notice] = ''Article was successfully updated.'' > render :action => ''show'' > end > end > > When I hit the save button the item.tag isn''t written. I thought that since > the Article class uses: > has_one :item > then the item record was to be saved when the article is saved? Together > with the item.tags? > > As it is now I have to add extra code for saving the item. Why is that? Am > I doing something wrong? > > > Ronny > > > On 9/5/05, Demetrius Nunes <demetrius-fDpYTK8McCzCdMRJFJuMdgh0onu2mTI+@public.gmane.org> wrote: > > Hello folks, > > > > There´s a brand new version of *acts_as_taggable* available at the same > > place as before: > > > > > http://dema.ruby.com.br/articles/2005/09/03/tagging-on-steroids-with-rails > > > > It features bugfixes (thanks to Geoffrey Rosenbach and technoweenie), > > improved API (thanks to some nice ideas from Ronny Hanssen) and full, > > complete RDoc documentation: > > http://dema.ruby.com.br/files/doc/index.html > > > > You can now use a regular text_field helper to tag your objects very > > easily on HTML forms, like this: > > <%= text_field ''photo'', ''tag_names'' %> > > > > This thing just keeps getting better and better! ;-) > > > > Best regards, > > Dema > > -- > > http://dema.ruby.com.br - Rails from a .NET perspective > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Wow, great work! I have one wish so far: *) An easy way to get a list of all tags and use counts Photos.get_tag_list [''blue'', ''snow'', ''zephyr''] Photos.get_tag_list_with_count (defaults sort from largest to lowest count) [[''blue'', 10], [''snow'', 4], [''zephyr'', 1]] or something of the like that''s easy to sort. Thanks, -San Demetrius Nunes wrote:> Hello folks, > > There´s a brand new version of *acts_as_taggable* available at the same > place as before: > > http://dema.ruby.com.br/articles/2005/09/03/tagging-on-steroids-with-rails > > It features bugfixes (thanks to Geoffrey Rosenbach and technoweenie), > improved API (thanks to some nice ideas from Ronny Hanssen) and full, > complete RDoc documentation: > http://dema.ruby.com.br/files/doc/index.html > > You can now use a regular text_field helper to tag your objects very > easily on HTML forms, like this: > <%= text_field ''photo'', ''tag_names'' %> > > This thing just keeps getting better and better! ;-) > > Best regards, > Dema