Class: AwesomeTranslations::GroupsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/awesome_translations/groups_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
# File 'app/controllers/awesome_translations/groups_controller.rb', line 5

def index; end

#showObject



7
8
9
10
11
# File 'app/controllers/awesome_translations/groups_controller.rb', line 7

def show
  @ransack_params = params[:q] || {}
  @ransack = @group.handler_translations.ransack(@ransack_params)
  @translations = @ransack.result
end

#updateObject



13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/awesome_translations/groups_controller.rb', line 13

def update
  @group.handler_translations.each do |translation|
    values = values_from_translation(translation)
    next unless values

    save_values(translation, values)
  end

  I18n.backend.reload!
  redirect_to handler_group_path(@handler, @group)
end

#update_translations_cacheObject



25
26
27
28
29
30
# File 'app/controllers/awesome_translations/groups_controller.rb', line 25

def update_translations_cache
  generator = AwesomeTranslations::CacheDatabaseGenerator.current
  generator.update_translations_for_group(@handler, @group)

  redirect_back(fallback_location: :root)
end