fix config value override
Conflicts: app/helpers/admin/configs_helper.rb
This commit is contained in:
parent
68ccc19c70
commit
0f7dc37015
1 changed files with 5 additions and 3 deletions
|
@ -121,9 +121,11 @@ module Admin::ConfigsHelper
|
||||||
def config_input_field_options(form, key, options)
|
def config_input_field_options(form, key, options)
|
||||||
cfg_path = form.lookup_model_names[1..-1] + [key]
|
cfg_path = form.lookup_model_names[1..-1] + [key]
|
||||||
# set current value
|
# set current value
|
||||||
value = @cfg
|
unless options.has_key?(:value)
|
||||||
cfg_path.each {|n| value = value[n] unless value.nil? }
|
value = @cfg
|
||||||
options[:value] ||= value
|
cfg_path.each {|n| value = value[n.to_sym] if value.respond_to? :[] }
|
||||||
|
options[:value] = value
|
||||||
|
end
|
||||||
options
|
options
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue