Sha256: fae44837250429a314297258b7435bd1745b3eef9300935f760d579d19e2fe56

Contents?: true

Size: 590 Bytes

Versions: 2

Compression:

Stored size: 590 Bytes

Contents

module Weeler
  class StaticSectionsController < ContentController
    def show
      @section = params[:id]
      @items = Weeler.static_sections[@section.to_sym]
    end

    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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
weeler-2.1.0 app/controllers/weeler/static_sections_controller.rb
weeler-2.0.1 app/controllers/weeler/static_sections_controller.rb