Sha256: bc53d41c312eb1f084f8ee8622b7596ba69727605ed3a4cc51d8d2222c8867cf

Contents?: true

Size: 428 Bytes

Versions: 16

Compression:

Stored size: 428 Bytes

Contents

class TagsController < ApplicationController
  respond_to :json

  def index
    respond_to do |format|
      format.json do
        tags = begin
          if params[:search]
            ActsAsTaggableOn::Tag.distinct.where('name LIKE ?', "%#{params[:search]}%").pluck(:name)
          else
            ActsAsTaggableOn::Tag.distinct.pluck(:name)
          end
        end

        render json: tags
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev app/controllers/tags_controller.rb
aleph_analytics-0.4.8 app/controllers/tags_controller.rb
aleph_analytics-0.4.7 app/controllers/tags_controller.rb
aleph_analytics-0.4.4 app/controllers/tags_controller.rb
aleph_analytics-0.4.2 app/controllers/tags_controller.rb
aleph_analytics-0.4.1 app/controllers/tags_controller.rb
aleph_analytics-0.3.0 app/controllers/tags_controller.rb
aleph_analytics-0.2.0 app/controllers/tags_controller.rb
aleph_analytics-0.1.0 app/controllers/tags_controller.rb
aleph_analytics-0.0.6 app/controllers/tags_controller.rb
aleph_analytics-0.0.5 app/controllers/tags_controller.rb
aleph_analytics-0.0.4 app/controllers/tags_controller.rb
aleph_analytics-0.0.3 app/controllers/tags_controller.rb
aleph_analytics-0.0.2 app/controllers/tags_controller.rb
aleph_analytics-0.0.1.alpha app/controllers/tags_controller.rb
aleph_analytics-0.0.0.alpha app/controllers/tags_controller.rb