Class: Kaui::HomeController
- Inherits:
-
EngineController
- Object
- ApplicationController
- EngineController
- Kaui::HomeController
- Defined in:
- app/controllers/kaui/home_controller.rb
Constant Summary collapse
- QUERY_PARSE_REGEX =
['FIND:(?<object_type>.*) BY:(?<search_by>.*) FOR:(?<search_for>.*) ONLY_FIRST:(?<fast>.*)', 'FIND:(?<object_type>.*) BY:(?<search_by>.*) FOR:(?<search_for>.*)', 'FIND:(?<object_type>.*) FOR:(?<search_for>.*) ONLY_FIRST:(?<fast>.*)', 'FIND:(?<object_type>.*) FOR:(?<search_for>.*)'].freeze
- SIMPLE_PARSE_REGEX =
'(?<search_for>.*)'
Constants included from EngineControllerUtil
EngineControllerUtil::MAXIMUM_NUMBER_OF_RECORDS_DOWNLOAD, EngineControllerUtil::SIMPLE_PAGINATION_THRESHOLD
Instance Method Summary collapse
Methods inherited from EngineController
#check_for_redirect_to_tenant_screen, #current_ability, #current_user, #options_for_klient, #populate_account_details, #retrieve_allowed_users_for_current_user, #retrieve_tenants_for_current_user
Methods included from ErrorHandler
Instance Method Details
#index ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/controllers/kaui/home_controller.rb', line 12 def index @search_query = params[:q] @max_records = {} %w[account payment invoice].each do |type| model = "Kaui::#{type.capitalize}".constantize @max_records[type.to_sym] = model.list_or_search(nil, 0, 0, ).pagination_max_nb_records || 0 end end |
#search ⇒ Object
21 22 23 24 25 26 |
# File 'app/controllers/kaui/home_controller.rb', line 21 def search object_type, search_query = splitting_new_search(params[:q]) object_type = object_type.tr(' ', '_').downcase = send("#{object_type}_search", search_query, nil, 0, ) end |