Class: Spree::Admin::ImageSettingsController

Inherits:
BaseController show all
Defined in:
app/controllers/spree/admin/image_settings_controller.rb

Instance Method Summary collapse

Methods included from Core::ControllerHelpers::Common

included

Methods included from Core::ControllerHelpers::Auth

#current_ability, included, #redirect_back_or_default, #store_location, #try_spree_current_user, #unauthorized

Instance Method Details

#editObject



4
5
6
7
# File 'app/controllers/spree/admin/image_settings_controller.rb', line 4

def edit
  @styles = ActiveSupport::JSON.decode(Spree::Config[:attachment_styles])
  @headers = ActiveSupport::JSON.decode(Spree::Config[:s3_headers])
end

#updateObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/spree/admin/image_settings_controller.rb', line 9

def update
  update_styles(params)
  update_headers(params) if Spree::Config[:use_s3]

  Spree::Config.set(params[:preferences])
  update_paperclip_settings

  respond_to do |format|
    format.html {
      flash[:success] = t(:image_settings_updated)
      redirect_to edit_admin_image_settings_path
    }
  end
end