From b225de9711e012a8ade32cc4fc947f41cbb184a1 Mon Sep 17 00:00:00 2001 From: Bob Remeika Date: Thu, 24 Sep 2009 21:12:11 -0700 Subject: Added assert_data_element_json test helper for data element helpers --- actionpack/lib/action_view/helpers/ajax_helper.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/ajax_helper.rb b/actionpack/lib/action_view/helpers/ajax_helper.rb index 05e5fca484..18b4c4991f 100644 --- a/actionpack/lib/action_view/helpers/ajax_helper.rb +++ b/actionpack/lib/action_view/helpers/ajax_helper.rb @@ -94,10 +94,12 @@ module ActionView end end - if options[:with] && (options[:with] !~ /[\{=(.]/) - options[:with] = "'#{options[:with]}=' + encodeURIComponent(value)" - else - options[:with] ||= 'value' unless options[:function] + if options[:with] + if options[:with] !~ /[\{=(.]/ + options[:with] = "'#{options[:with]}=' + encodeURIComponent(value)" + else + options[:with] ||= 'value' unless options[:function] + end end if options[:function] -- cgit v1.2.3