Sha256: e4914fb1dddc1ba9338c1301766ea781509e24e25f241e135b6f7a8203574092
Contents?: true
Size: 469 Bytes
Versions: 240
Compression:
Stored size: 469 Bytes
Contents
class TagsController < ApplicationController before_filter :authenticate_user! def index @tags = ActsAsTaggableOn::Tag.where('name like ?','%'+params[:tag]+'%').limit(10) response = @tags.map{ |t| { 'key' => t.name, 'value' => t.name } }.to_json if @tags.count == 0 response = "[{\"key\":\""+params[:tag]+"\" , \"value\":\""+params[:tag]+"\"}]" end respond_to do |format| format.json { render :text => response} end end end
Version data entries
240 entries across 240 versions & 4 rubygems