From 3cfb894bac2f25f2160189e4909ae7756927d8ad Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Sun, 3 Jun 2007 14:27:43 +0000 Subject: Allow JSON-style values for the :with option of observe_field. Closes #8557 [kommen] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6930 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/prototype_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 8c3cd907ff..33e52bfa6e 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -698,7 +698,7 @@ module ActionView end def build_observer(klass, name, options = {}) - if options[:with] && (options[:with] !~ /[=(.]/) + if options[:with] && (options[:with] !~ /[\{=(.]/) options[:with] = "'#{options[:with]}=' + value" else options[:with] ||= 'value' unless options[:function] -- cgit v1.2.3