app/controllers/georgia/api/media_controller.rb in georgia-0.7.6 vs app/controllers/georgia/api/media_controller.rb in georgia-0.7.7

- old
+ new

@@ -1,16 +1,11 @@ module Georgia module Api class MediaController < Georgia::ApplicationController 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 + @pictures = Georgia::Indexer.search(Ckeditor::Picture, params.merge(per: 12)) + @pictures = Ckeditor::PictureDecorator.decorate_collection(@pictures) render layout: false end end end \ No newline at end of file