Class: Spree::Admin::TntMercurioSettingsController

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

Instance Method Summary collapse

Instance Method Details

#editObject



3
4
5
6
7
# File 'app/controllers/spree/admin/tnt_mercurio_settings_controller.rb', line 3

def edit
  @tax_situations = [:co, :nc, :ci, :cm, :cn, :me, :mn, :pr, :pn, :op, :on, :of]
  @user_attr = Spree::User.new.attribute_names
  @config = Spree::TntMercurioConfiguration.new
end

#updateObject



9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/spree/admin/tnt_mercurio_settings_controller.rb', line 9

def update
  config = Spree::TntMercurioConfiguration.new

  params.each do |name, value|
    next unless config.has_preference? name
    config[name] = value
  end
  flash[:success] = Spree.t(:successfully_updated, resource: Spree.t(:tnt_mercurio_settings))
  redirect_to edit_admin_tnt_mercurio_settings_path
end