Sha256: 2621a61f5ca3a0cb906315d9e6898fcdedfff1f8d07018ba602c7dea7a0e11b1

Contents?: true

Size: 750 Bytes

Versions: 12

Compression:

Stored size: 750 Bytes

Contents

module Weeler
  class SeoItemsController < ConfigurationController

    def index
      @translations_in_seo = I18n::Backend::Weeler::Translation.select("key").where("key LIKE ?", "seo.%").order("key")
      @groups = @translations_in_seo.map{ |t| t.key.split(".")[1] }.uniq{ |t| t}
    end

    def edit
      @section = params[:id]
    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
      Settings.i18n_updated_at = Time.now
      redirect_to({action: :edit, id: params[:id]}, {flash: {success: "Section updated."}})
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
weeler-2.0.0 app/controllers/weeler/seo_items_controller.rb
weeler-1.6.0 app/controllers/weeler/seo_items_controller.rb
weeler-1.5.4 app/controllers/weeler/seo_items_controller.rb
weeler-1.5.2 app/controllers/weeler/seo_items_controller.rb
weeler-1.5.1 app/controllers/weeler/seo_items_controller.rb
weeler-1.4.0 app/controllers/weeler/seo_items_controller.rb
weeler-1.2.0 app/controllers/weeler/seo_items_controller.rb
weeler-1.1.0 app/controllers/weeler/seo_items_controller.rb
weeler-1.0.4 app/controllers/weeler/seo_items_controller.rb
weeler-1.0.3 app/controllers/weeler/seo_items_controller.rb
weeler-1.0.2 app/controllers/weeler/seo_items_controller.rb
weeler-1.0.1 app/controllers/weeler/seo_items_controller.rb