Sha256: e4d6011f0cc4f31d1073ba1ace022bd7fdd3a51209ea262c73f255547940c6f4

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

module Georgia
  module Api
    class TagsController < Georgia::ApplicationController

      respond_to :json

      def index
        authorize ActsAsTaggableOn::Tag
        @tags = ActsAsTaggableOn::Tag.pluck(:name)
        respond_with(@tags)
      end

      def search
        authorize ActsAsTaggableOn::Tag
        search_conditions = Georgia::TagSearch.new(params).definition
        @search = ActsAsTaggableOn::Tag.search(search_conditions).page(params[:page])
        respond_with(@search.records.map(&:name))
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
georgia-0.8.0 app/controllers/georgia/api/tags_controller.rb