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

#indexObject



7
8
9
10
11
# File 'app/controllers/georgia/api/tags_controller.rb', line 7

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

#searchObject



13
14
15
16
17
18
# File 'app/controllers/georgia/api/tags_controller.rb', line 13

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