Class: Forge::SettingsController

Inherits:
ForgeController show all
Defined in:
lib/forge/app/controllers/forge/settings_controller.rb

Instance Method Summary collapse

Methods inherited from ForgeController

#get_menu_items, #load_help, #set_crumbs, #set_title, #uses_ckeditor

Methods inherited from ApplicationController

#app_init

Instance Method Details

#showObject



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

def show
  @carriers = ActiveMerchant::Shipping::Carriers.all.delete_if { |c| c.name =~ /Bogus/ }
  @settings = MySettings
  @tab = params[:tab] == 'video' ? 1 : 0
end

#updateObject



2
3
4
5
6
7
# File 'lib/forge/app/controllers/forge/settings_controller.rb', line 2

def update
  force_boolean(params[:settings])
  params[:settings].each { |key, value| MySettings.send((key + '=').to_sym, value) }
  flash[:notice] = "Your settings have been saved."
  redirect_to forge_settings_path
end