Class: Radmin::SettingsController
- Inherits:
-
RadminController
- Object
- ApplicationController
- RadminController
- Radmin::SettingsController
- Defined in:
- app/controllers/radmin/settings_controller.rb
Instance Method Summary collapse
Methods inherited from RadminController
Instance Method Details
#create ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/controllers/radmin/settings_controller.rb', line 4 def create Radmin::Setting["#{params[:setting]['key']}"] = params[:setting]['value'] flash[:notice] = Radmin::I18n.t(:setting_sucessfully_created, :default => "Setting sucessfully created.") redirect_to admin_settings_url rescue ActiveRecord::RecordInvalid render :action => :new end |
#destroy ⇒ Object
21 22 23 24 25 |
# File 'app/controllers/radmin/settings_controller.rb', line 21 def destroy @setting.destroy flash[:notice] = Radmin::I18n.t(:setting_sucessfully_deleted, :default => "Setting sucessfully deleted.") redirect_to admin_settings_url end |
#update ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/controllers/radmin/settings_controller.rb', line 12 def update @setting.value = params[:setting]['value'] @setting.save! flash[:notice] = Radmin::I18n.t(:setting_sucessfully_updated, :default => "Setting sucessfully updated.") redirect_to admin_settings_url rescue ActiveRecord::RecordInvalid render :action => :edit end |