Class: Cardboard::SettingsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Cardboard::SettingsController
- Defined in:
- app/controllers/cardboard/settings_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
7 8 9 |
# File 'app/controllers/cardboard/settings_controller.rb', line 7 def index @setting = Setting.first end |
#update ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/cardboard/settings_controller.rb', line 11 def update @setting = params[:id].present? ? Setting.find(params[:id]) : Setting.first if @setting.update_attributes(strong_params[:setting]) flash[:success] = "Settings updated successfully" redirect_to settings_path else render :index end end |