Class: Kaui::HomeController

Inherits:
EngineController show all
Defined in:
app/controllers/kaui/home_controller.rb

Constant Summary

Constants included from EngineControllerUtil

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

Instance Method Details

#indexObject



3
4
5
# File 'app/controllers/kaui/home_controller.rb', line 3

def index
  @search_query = params[:q]
end

#searchObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/kaui/home_controller.rb', line 7

def search
  search_type, search_query = parse_query(params[:q])
  if search_type == 'invoice'
    redirect_to invoice_path(:id => search_query)
  elsif search_type == 'payment'
    redirect_to payment_path(:id => search_query)
  elsif search_type == 'transaction'
    redirect_to transaction_path(:id => search_query)
  else
    redirect_to accounts_path(:q => search_query, :fast => params[:fast])
  end
end