Class: Georgia::Api::TagsController

Inherits:
Georgia::ApplicationController show all
Defined in:
app/controllers/georgia/api/tags_controller.rb

Instance Method Summary collapse

Methods inherited from Georgia::ApplicationController

#current_ability, #current_locale

Instance Method Details

#searchObject



8
9
10
11
12
13
14
15
# File 'app/controllers/georgia/api/tags_controller.rb', line 8

def search
  @tags = Georgia::Indexer.search(ActsAsTaggableOn::Tag, params)

  # Format for select2
  @tags = @tags.map{|t| {id: t.id, text: t.name}}

  respond_with(results: @tags)
end