The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
631 B

  1. # frozen_string_literal: true
  2. module Admin
  3. class SettingsController < BaseController
  4. def edit
  5. authorize :settings, :show?
  6. @admin_settings = Form::AdminSettings.new
  7. end
  8. def update
  9. authorize :settings, :update?
  10. @admin_settings = Form::AdminSettings.new(settings_params)
  11. if @admin_settings.save
  12. flash[:notice] = I18n.t('generic.changes_saved_msg')
  13. redirect_to edit_admin_settings_path
  14. else
  15. render :edit
  16. end
  17. end
  18. private
  19. def settings_params
  20. params.require(:form_admin_settings).permit(*Form::AdminSettings::KEYS)
  21. end
  22. end
  23. end