include hide empty option for tag search

This commit is contained in:
albert
2013-02-19 13:33:45 -05:00
parent e7aff87c65
commit bbbb6ceb51
2 changed files with 14 additions and 1 deletions

View File

@@ -400,6 +400,10 @@ class Tag < ActiveRecord::Base
q = q.where("category = ?", params[:category])
end
if params[:hide_empty] == "yes"
q = q.where("post_count > 0")
end
case params[:sort].present?
when "count"
q = q.order("post_count desc")