Class: ForemanOpensearch::OpensearchController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/foreman_opensearch/opensearch_controller.rb

Instance Method Summary collapse

Instance Method Details

#autocompleteObject



11
12
13
14
# File 'app/controllers/foreman_opensearch/opensearch_controller.rb', line 11

def autocomplete
  items = [params[:q], ['hosts:', 'users:']]
  render :json => items
end

#descriptionObject



8
9
# File 'app/controllers/foreman_opensearch/opensearch_controller.rb', line 8

def description
end

#searchObject



3
4
5
6
# File 'app/controllers/foreman_opensearch/opensearch_controller.rb', line 3

def search
  target_controller, _sep, query = params[:q].partition(':')
  redirect_to :controller => "/#{target_controller}", :action => :index, :search => query
end