Sha256: 0e042268bdf3b66c0329dd1e56cc4cbb0d49b7e0e494cba009ad50abc6610a0d

Contents?: true

Size: 1.18 KB

Versions: 43

Compression:

Stored size: 1.18 KB

Contents

module Spree
  module Admin
    class GeneralSettingsController < Spree::Admin::BaseController

      def edit
        @preferences_general = [:site_name, :default_seo_title, :default_meta_keywords,
                        :default_meta_description, :site_url]
        @preferences_security = [:allow_ssl_in_production,
                        :allow_ssl_in_staging, :allow_ssl_in_development_and_test,
                        :check_for_spree_alerts]
        @preferences_currency = [:display_currency, :hide_cents]
      end

      def update
        params.each do |name, value|
          next unless Spree::Config.has_preference? name
          Spree::Config[name] = value
        end
        flash[:success] = Spree.t(:successfully_updated, :resource => Spree.t(:general_settings))

        redirect_to edit_admin_general_settings_path
      end

      def dismiss_alert
        if request.xhr? and params[:alert_id]
          dismissed = Spree::Config[:dismissed_spree_alerts] || ''
          Spree::Config.set :dismissed_spree_alerts => dismissed.split(',').push(params[:alert_id]).join(',')
          filter_dismissed_alerts
          render :nothing => true
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
spree_backend-2.0.1 app/controllers/spree/admin/general_settings_controller.rb
spree_backend-2.0.0 app/controllers/spree/admin/general_settings_controller.rb
spree_backend-2.0.0.rc1 app/controllers/spree/admin/general_settings_controller.rb