Class: Admin::PageSearchController

Inherits:
AdminController show all
Defined in:
app/controllers/admin/page_search_controller.rb

Instance Method Summary collapse

Methods inherited from SlicesController

should_raise_exceptions?

Instance Method Details

#showObject



6
7
8
9
10
# File 'app/controllers/admin/page_search_controller.rb', line 6

def show
  @query = params[:query]
  @pages = Page.where(name: Regexp.new(@query, true), role: nil).limit(5)
  render json: @pages.uniq.as_json
end