Class: Admin::SettingsController

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

Instance Method Summary collapse

Instance Method Details

#delete_cacheObject

This method delete all page in cache



28
29
30
31
32
# File 'app/controllers/admin/settings_controller.rb', line 28

def delete_cache
  PageCache.sweep_all
  flash[:notice] = 'All cache is deleted'
  redirect_to :action => 'index'
end

#follow_setting_updateObject



34
35
36
37
38
39
40
41
42
# File 'app/controllers/admin/settings_controller.rb', line 34

def follow_setting_update
  #@imports is affect in before_filter
  respond_to do |format|
    format.html{
      redirect_to :action => 'index' if Import.picture_update.count < 1
    }
    format.js{render :layout => false}
  end
end

#indexObject

View form of settings



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

def index
end

#updateObject

Update the settings



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/admin/settings_controller.rb', line 10

def update
  respond_to do |format|
    if this_webapp.update_attributes(params[:setting])
      flash[:notice] = 'Settings was successfully updated.'
      format.html { 
        if Import.picture_update.count > 0
          redirect_to :controller => 'settings', :action => 'follow_setting_update'
        else
          redirect_to admin_settings_url 
        end
      }
    else
      format.html { render :action => "index" }
    end
  end
end