Class: Saml::SamlSettingsBaseController
- Inherits:
-
SamlBaseController
- Object
- ApplicationController
- SamlBaseController
- Saml::SamlSettingsBaseController
- Defined in:
- app/controllers/saml/saml_settings_base_controller.rb
Overview
Controller to register saml by SP
Direct Known Subclasses
Instance Method Summary collapse
-
#edit ⇒ Object
GET /saml/account_class/:#account_class_#account_find_key/saml_settings/edit.
-
#show ⇒ Object
GET /saml/account_class/:#account_class_#account_find_key/saml_settings.
-
#update ⇒ Object
PATCH /saml/account_class/:#account_class_#account_find_key/saml_settings.
Instance Method Details
#edit ⇒ Object
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 account = setting.account_class.find_by!(setting.account_find_key => params["#{setting.account_class.to_s.downcase}_#{setting.account_find_key}"]) @saml_setting = account.saml_setting.present? ? account.saml_setting : account.build_smal_setting end |
#show ⇒ Object
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 account = setting.account_class.find_by!(setting.account_find_key => params["#{setting.account_class.to_s.downcase}_#{setting.account_find_key}"]) @saml_setting = account.saml_setting.present? ? account.saml_setting : account.build_smal_setting end |
#update ⇒ Object
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 account = setting.account_class.find_by!(setting.account_find_key => params["#{setting.account_class.to_s.downcase}_#{setting.account_find_key}"]) @saml_setting = account.saml_setting.present? ? account.saml_setting : account.build_smal_setting @saml_setting.assign_attributes(saml_setting_params) if @saml_setting.save redirect_to action: :show else render :edit end end |