Class: Spree::Admin::ImageSettingsController

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

Instance Attribute Summary

Attributes included from Core::ControllerHelpers

#title

Instance Method Summary collapse

Methods included from Core::ControllerHelpers

#access_forbidden, included

Instance Method Details

#editObject



9
10
11
12
# File 'app/controllers/spree/admin/image_settings_controller.rb', line 9

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

#showObject



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

def show
  styles = ActiveSupport::JSON.decode(Spree::Config[:attachment_styles])
  @styles_list = styles.collect { |k, v| k }.join(", ")
end

#updateObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/spree/admin/image_settings_controller.rb', line 14

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[:notice] = t(:image_settings_updated)
      redirect_to admin_image_settings_path
    }
  end
end