Class: Saml::SamlSettingsBaseController

Inherits:
SamlBaseController show all
Defined in:
app/controllers/saml/saml_settings_base_controller.rb

Overview

Controller to register saml by SP

Direct Known Subclasses

SamlSettingsController

Instance Method Summary collapse

Instance Method Details

#editObject

GET /saml/account_class/:#account_class_#account_find_key/saml_settings/edit



12
13
14
15
16
# File 'app/controllers/saml/saml_settings_base_controller.rb', line 12

def edit
  setting = SpRailsSaml::Settings.instance
   = setting..find_by!(setting. => params["#{setting..to_s.downcase}_#{setting.}"])
  @saml_setting = .saml_setting.present? ? .saml_setting : .build_smal_setting
end

#showObject

GET /saml/account_class/:#account_class_#account_find_key/saml_settings



5
6
7
8
9
# File 'app/controllers/saml/saml_settings_base_controller.rb', line 5

def show
  setting = SpRailsSaml::Settings.instance
   = setting..find_by!(setting. => params["#{setting..to_s.downcase}_#{setting.}"])
  @saml_setting = .saml_setting.present? ? .saml_setting : .build_smal_setting
end

#updateObject

PATCH /saml/account_class/:#account_class_#account_find_key/saml_settings



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/saml/saml_settings_base_controller.rb', line 19

def update
  setting = SpRailsSaml::Settings.instance
   = setting..find_by!(setting. => params["#{setting..to_s.downcase}_#{setting.}"])
  @saml_setting = .saml_setting.present? ? .saml_setting : .build_smal_setting

  @saml_setting.assign_attributes(saml_setting_params)

  if @saml_setting.save
    redirect_to action: :show
  else
    render :edit
  end
end