Class: Georgia::Api::MediaController

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

Instance Method Summary collapse

Methods inherited from Georgia::ApplicationController

#current_ability, #current_locale

Instance Method Details

#picturesObject



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/georgia/api/media_controller.rb', line 5

def pictures
  @search = Ckeditor::Picture.search do
    fulltext params[:query] do
      fields(:filename, :tags)
    end
    paginate(page: params[:page], per_page: (params[:per] || 12))
  end
  @pictures = @search.results
  render layout: false
end