Class: Kakimasu::HomeController

Inherits:
ApplicationController
  • Object
show all
Includes:
CountingHelper, SearchTranslationsHelper
Defined in:
app/controllers/kakimasu/home_controller.rb

Instance Method Summary collapse

Methods included from CountingHelper

#countKeys, #translationPercentage

Methods included from SearchTranslationsHelper

#find_attribute_keys, #find_keys, #find_missing_translations_keys, #find_model_name_keys, #missing_translations?, #prefix, #search_for_translations

Instance Method Details

#indexObject



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

def index
  # Check if user has permissions
  authorize :translation, :index?
  policy_scope(Translation)

  # Get translation percentage
  @all_keys_count = countKeys(search_for_translations('all_translation_keys'))
  @missing_translation_keys_count = countKeys(search_for_translations('missing_translations'))
  @percentage = translationPercentage(@all_keys_count, @missing_translation_keys_count)
end