Class: Weeler::StaticSectionsController

Inherits:
ContentController show all
Defined in:
app/controllers/weeler/static_sections_controller.rb

Instance Method Summary collapse

Methods inherited from ContentController

#index

Instance Method Details

#showObject



3
4
5
6
# File 'app/controllers/weeler/static_sections_controller.rb', line 3

def show
  @section = params[:id]
  @items = Weeler.static_sections[@section.to_sym]
end

#updateObject



8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/weeler/static_sections_controller.rb', line 8

def update
  params[:translations].each do |translation|
    id, value = translation.first, translation.last
    translation = I18n::Backend::Weeler::Translation.find(id)
    translation.value = value
    translation.save
  end
  Setting.i18n_updated_at = Time.current
  redirect_to({ action: :show, id: params[:id] }, { flash: { success: "Section updated." } })
end