Class: Admin::SettingsController

Inherits:
BaseController show all
Defined in:
app/controllers/admin/settings_controller.rb

Instance Method Summary collapse

Methods included from BlogHelper

#blog_base_url, #this_blog

Instance Method Details

#displayObject



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

def display
  load_settings
end

#feedbackObject



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

def feedback
  load_settings
end

#indexObject



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

def index
  this_blog.base_url = blog_base_url if this_blog.base_url.blank?
  load_settings
end

#updateObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/controllers/admin/settings_controller.rb', line 19

def update
  load_settings
  if @setting.update_attributes(settings_params)
    load_lang
    flash[:success] = I18n.t('admin.settings.update.success')
    redirect_to action: action_param
  else
    flash[:error] = I18n.t('admin.settings.update.error',
                           messages: this_blog.errors.full_messages.join(', '))
    render action_param
  end
end

#writeObject



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

def write
  load_settings
end