class AlertSettingsController
Manages the singleton global alert settings: SMTP server and the Slack webhook URL used by every channel. Each action authorizes with Pundit.
Public Instance Methods
Source
# File app/controllers/alert_settings_controller.rb, line 5 def show authorize AlertSetting @setting = AlertSetting.instance end
Shows the global settings form.
Source
# File app/controllers/alert_settings_controller.rb, line 11 def update authorize AlertSetting @setting = AlertSetting.instance if @setting.update(setting_params) redirect_to alert_settings_path, notice: t("alert_settings.notices.updated") else render :show, status: :unprocessable_content end end
Updates the global settings and redirects to the form, or re-renders it.