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



17
18
19
# File 'app/controllers/admin/settings_controller.rb', line 17

def display
  load_settings
end

#feedbackObject



13
14
15
# File 'app/controllers/admin/settings_controller.rb', line 13

def feedback
  load_settings
end

#indexObject



4
5
6
7
# File 'app/controllers/admin/settings_controller.rb', line 4

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

#updateObject



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

def update
  load_settings
  if @setting.update(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



9
10
11
# File 'app/controllers/admin/settings_controller.rb', line 9

def write
  load_settings
end