Search code examples
ruby-on-railsruby-on-rails-3acts-as-taggable-on

How can I sort by "updated_date desc" with the gem 'acts_as_taggable_on_steroids'?


I'm using

This fetches 10 tags of the most pupular tags

@tags = Post.tag_counts_on(:tags, :limit => 10, :order => "count desc") 

This fetches 10 tags of the oldest tags

@tags = Post.tag_counts_on(:tags, :limit => 10) 

How can I fetch 10 tags of the newest tags?


Solution

  • What about sorting via id and get the newest?

    @tags = Post.tag_counts_on(:tags, :limit => 10, :order => "id asc")