Class: Tenon::SettingsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/tenon/settings_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



10
11
12
13
# File 'app/controllers/tenon/settings_controller.rb', line 10

def show
  authorize! :update, Tenon::MySettings
  @settings = Tenon::MySettings
end

#updateObject



3
4
5
6
7
8
# File 'app/controllers/tenon/settings_controller.rb', line 3

def update
  authorize! :update, Tenon::MySettings
  params[:settings].each { |key, value| Tenon::MySettings.send((key + '=').to_sym, value) }
  flash[:notice] = 'Your settings have been saved.'
  redirect_to settings_path
end