Class: SettingsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SettingsController
- Defined in:
- app/controllers/settings_controller.rb
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
15 16 17 18 |
# File 'app/controllers/settings_controller.rb', line 15 def edit @setting = Setting.first switch_to_admin_layout end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/settings_controller.rb', line 6 def index redirect_to setting_path(Setting.first) end |
#show ⇒ Object
10 11 12 13 |
# File 'app/controllers/settings_controller.rb', line 10 def show @setting = Setting.first switch_to_admin_layout end |
#update ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/controllers/settings_controller.rb', line 20 def update @setting = Setting.first if @setting.update_attributes(setting_params) redirect_to @setting, notice: t('settings.update.notice') else render action: "edit", warning: t('settings.update.warning') end end |