Displaying 8 results from an estimated 8 matches for "tags_count".
2005 Sep 06
9
acts_as_taggable v4 - Tag Counting Anyone?
ThereĀ“s already a new version of the acts_as_taggable mixin available
and look what it is capable of now:
# Gets the top 10 tags for all photos
Photo.tags_count :limit => 10 # => { ''beer'' => 68, ''wine'' => 37, ''vodka''
=> ''22'', ... }
# Gets the tags count that are greater than 30
Photo.tags_count :count => ''> 30'' # => { ''beer''...
2006 Apr 01
3
acts_as_taggable, wrong number of arguments
Hello,
When I try:
@tagged_items = Problem.find_tagged_with :all => ''kuba''
or
@tagged_items = Problem.tags_count :limit => 100
I get this error:
ArgumentError in Volume#index
wrong number of arguments (2 for 3)
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
/usr/local/lib/ruby/gems/1.8/gems/acts_as_taggable-1.0.4/lib/taggable.rb:244:in
`add_limit!'...
2006 Apr 04
5
How to implement tag clouds using plugin?
The code on
http://blog.craz8.com/articles/2005/10/28/acts_as_taggable-is-a-cool-piece-of-code
is based on the acts_as_taggable gem,anybody has done that using the
acts_as_taggable plugin?thanks!
btw:the code above uses the tag_count method,which is defined in the
gem:
def tags_count(options = {})
options = {:order => ''count DESC''}.merge(options)
o, t, o_pk, o_fk, t_pk, t_fk = table_name,
tag_model.table_name, primary_key, taggable_foreign_key,
tag_model.primary_key, tag_foreign_key
jt = tags_join_model ? tags_join_model.tab...
2006 Apr 26
3
acts_as_taggable gem: deleting tags
I have the following quick-and-dirty hack in my model:
def after_destroy
# search for orphaned tags and delete them
orphans = Resource.tags_count :count => ''= 0''
orphans.keys.each {|tag| Tags.find_by_name(''tag'').destroy}
end
It''s nice from a readable code perspective, but it seems inefficient -
is there some way to do this with only one query?
martin
2006 Apr 28
1
acts_as_taggable help
...e a tagcloud, but now i want to filter items by tags.
in my controller i have
def show_tagged_with
<-- snip snip -->
@items = Item.find_tagged_with( :any => params[:tag_name])
@categories = Category.find_all
@tag_name = params[:tag_name]
@tagged_items = Item.tags_count(:limit => 100)
end
IN the VIEW
<% @items.each do |item| %>
<%= render :partial => ''list_stripes'', :locals => { :item => item } %>
<% end %>
Where the partial _list_stripes.rthml is a list of items
<td><%=h item.tag_names.join(&quo...
2006 Mar 28
2
add_limit (in acts_as_taggable) breaks in 1.1, solution?
Upgraded from Rails 1.0 to 1.1 and found that the (slightly modified)
acts_as_taggable plugin breaks. The line
add_limit!(sql, options)
(in the tags_count method) causes this error
wrong number of arguments (2 for 3)
The documentation still says it takes two args, so I''m not sure what''s
wrong. Adding
logger.info("SQL here: " + sql)
logger.info("Options here:" + options.inspect)
before the add_limit! ca...
2006 Mar 21
2
SQL bug in acts_as_taggable
Hi,
excuse me if this is off-topic and feel free to ingore it in case.
I''m using acts_as_taggable (the gem version) and found what to me
looks like a bug in this code from the method tags_count:
sql = "SELECT #{t}.#{t_pk} AS id, #{t}.name AS name, COUNT
(*) AS count
FROM #{jt}, #{o}, #{t} WHERE #{jt}.#{t_fk} = #{t}.#{t_pk}
AND #{jt}.#{o_fk} = #{o}.#{o_pk}"
sql << " AND #{sanitize_sql(options[:conditions])}" if
options[:c...
2006 Jun 22
1
acts_as_taggable gem problems
...r by freq desc''
End
tags/list.rb:
<ul>
<% @tags.each do |t| %>
<li><%= t.freq %> <%= t.name %></li>
<% end %>
</ul>
According to the acts_as_taggable gem rdocs
(ActiveRecord::Acts::Taggable::ClassMethods) I should be using
Issues.tags_count, but I get a NoMethodError. Any ideas? This
doesn''twork in the console either.
(I''ve since opened up taggable.rb and taken a look at the sql
involved. I have figured out the sql to do this in MS SQLserver to
give me the correct results, but this still doesn''t solve...