Files
openfoodnetwork/app/controllers/admin/matomo_settings_controller.rb
Maikel Linke 5b94049620 Whitelist params for several settings for Rails 5
Rails 5 is a bit stricter and Spree's Config#set method doesn't work
with a Parameters object.
2021-02-19 14:20:15 +11:00

24 lines
473 B
Ruby

module Admin
class MatomoSettingsController < Spree::Admin::BaseController
def update
Spree::Config.set(preferences_params.to_h)
respond_to do |format|
format.html {
redirect_to main_app.edit_admin_matomo_settings_path
}
end
end
private
def preferences_params
params.require(:preferences).permit(
:matomo_url,
:matomo_site_id,
:matomo_tag_manager_url,
)
end
end
end