Class: SettingsController

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

Instance Method Summary collapse

Instance Method Details

#editObject



15
16
17
18
# File 'app/controllers/settings_controller.rb', line 15

def edit
  @setting = Setting.first
  switch_to_admin_layout
end

#indexObject



6
7
8
# File 'app/controllers/settings_controller.rb', line 6

def index
  redirect_to setting_path(Setting.first)
end

#showObject



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

def show
  @setting = Setting.first
  switch_to_admin_layout
end

#updateObject



20
21
22
23
24
25
26
27
# File 'app/controllers/settings_controller.rb', line 20

def update
  @setting = Setting.first
  if @setting.update_attributes(setting_params)
    redirect_to @setting, notice: t('settings.update.notice')
  else
    render action: "edit", warning: t('settings.update.warning')
  end
end