Class: Admin::TagsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/admin/tags_controller.rb

Instance Method Summary collapse

Instance Method Details

#tagObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/admin/tags_controller.rb', line 3

def tag
  tags = ActsAsTaggableOn::Tag.find(:all,:conditions => ['name like ? ',"#{params[:tag]}%"])
  if tags.nil? || tags.blank? 
    render :json => ""
  else
    p tags.inspect
    tab = []
    tags.each do |tag|
      tab << tag.name
    end
  render :json => tab
  end
end