Class: Kommandant::SearchesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/kommandant/searches_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



2
3
4
5
6
7
8
# File 'app/controllers/kommandant/searches_controller.rb', line 2

def index
  @results = Kommandant::Command.search(params[:query])

  unless Kommandant.config.admin_only_filter_lambda.present? && Kommandant.config.admin_only_filter_lambda.call(current_user, current_admin)
    @results.reject!(&:admin_only?)
  end
end

#newObject



10
11
# File 'app/controllers/kommandant/searches_controller.rb', line 10

def new
end