Class: Spree::Admin::ReviewSettingsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/admin/review_settings_controller.rb

Instance Method Summary collapse

Instance Method Details

#process_unset_checkboxesObject



16
17
18
19
20
21
22
# File 'app/controllers/spree/admin/review_settings_controller.rb', line 16

def process_unset_checkboxes
  # workaround for unset checkbox behaviour
  params[:preferences] ||= {}
  Spree::ReviewsConfiguration.boolean_preferences.each do |sym|
    params[:preferences][sym] = false if params[:preferences][sym].blank?
  end
end

#updateObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/spree/admin/review_settings_controller.rb', line 6

def update
  Spree::Reviews::Config.set(params[:preferences])

  respond_to do |format|
    format.html do
      redirect_to edit_admin_review_settings_path
    end
  end
end