mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
Rails 5 is a bit stricter and Spree's Config#set method doesn't work with a Parameters object.
26 lines
537 B
Ruby
26 lines
537 B
Ruby
module Spree
|
|
module Admin
|
|
class TaxSettingsController < Spree::Admin::BaseController
|
|
def update
|
|
Spree::Config.set(preferences_params.to_h)
|
|
|
|
respond_to do |format|
|
|
format.html {
|
|
redirect_to spree.edit_admin_tax_settings_path
|
|
}
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def preferences_params
|
|
params.require(:preferences).permit(
|
|
:products_require_tax_category,
|
|
:shipment_inc_vat,
|
|
:shipping_tax_rate,
|
|
)
|
|
end
|
|
end
|
|
end
|
|
end
|