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)
|
||||
cfg_path = form.lookup_model_names[1..-1] + [key]
|
||||
# set current value
|
||||
unless options.has_key?(:value)
|
||||
value = @cfg
|
||||
cfg_path.each {|n| value = value[n] unless value.nil? }
|
||||
options[:value] ||= value
|
||||
cfg_path.each {|n| value = value[n.to_sym] if value.respond_to? :[] }
|
||||
options[:value] = value
|
||||
end
|
||||
options
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue