Class: SimpleShowcaseAdmin::SettingsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/simple_showcase_admin/settings_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#not_authenticated

Instance Method Details

#indexObject



3
4
5
# File 'app/controllers/simple_showcase_admin/settings_controller.rb', line 3

def index
  @settings = Setting.all
end

#updateObject



7
8
9
10
11
12
13
# File 'app/controllers/simple_showcase_admin/settings_controller.rb', line 7

def update
  params[:settings].each_pair do |setting, value|
    Setting.send("#{setting}=", value)
  end

  redirect_to [:settings], :notice => 'Settings updated' # Redirect to the settings index
end