Class: Shoppy::SettingsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Shoppy::SettingsController
- Defined in:
- app/controllers/shoppy/settings_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/shoppy/settings_controller.rb', line 9 def edit def edit @setting = Setting.first if @setting.update_attributes(setting_params) Log.newEvent("Settings", "Settings were updated", current_admin.name) flash[:notice] = "Settings have been updated." else flash[:errors] = @setting.errors. end redirect_to "/settings" end def setting_params params.require(:setting).permit(:app_name, :hostname, :base_url, :accounts_email_sender, :notification_email_sender, :currency_unit, :license_key) end end |
#setting_params ⇒ Object
21 22 23 |
# File 'app/controllers/shoppy/settings_controller.rb', line 21 def setting_params params.require(:setting).permit(:app_name, :hostname, :base_url, :accounts_email_sender, :notification_email_sender, :currency_unit, :license_key) end |
#show ⇒ Object
5 6 7 |
# File 'app/controllers/shoppy/settings_controller.rb', line 5 def show @setting = Setting.first end |