Class: Backend::SearchTermsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/backend/search_terms_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#breadcrumb, #current_admin, #default_app_locale, #translate_notice

Methods included from Udongo::Cryptography

#crypt

Instance Method Details

#destroy_allObject



10
11
12
13
# File 'app/controllers/backend/search_terms_controller.rb', line 10

def destroy_all
  ::SearchTerm.destroy_all
  redirect_to backend_search_terms_path, notice: t('b.msg.search_terms.deleted')
end

#indexObject



4
5
6
7
8
# File 'app/controllers/backend/search_terms_controller.rb', line 4

def index
  @search_terms = ::SearchTerm.select('*, COUNT(1) as total')
                              .group('locale, term')
                              .order('COUNT(1) DESC')
end