gitlabhq/app/controllers/tags_controller.rb

12 lines
327 B
Ruby
Raw Normal View History

2011-11-05 13:57:40 +01:00
class TagsController < ApplicationController
2011-11-15 09:34:30 +01:00
def index
@tags = Project.tag_counts.order('count DESC')
@tags = @tags.where('name like ?', "%#{params[:term]}%") unless params[:term].blank?
2011-11-05 13:57:40 +01:00
2011-11-15 09:34:30 +01:00
respond_to do |format|
format.html
format.json { render json: @tags.limit(8).map {|t| t.name}}
end
end
2011-11-05 13:57:40 +01:00
end