From 2d8679993c3e7ec2920fd818dacc7cb2000b9f89 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 29 Jun 2005 08:09:00 +0000 Subject: Fix JavaScriptHelper capitalization and make it compatible with Prototype #1545 [Sam Stephenson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1561 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/action_view/helpers/javascript_helper.rb | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index a0a4076103..c73c1e08b0 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -2,19 +2,19 @@ require File.dirname(__FILE__) + '/tag_helper' module ActionView module Helpers - # Provides a set of helpers for calling Javascript functions and, most importantly, to call remote methods using what has + # Provides a set of helpers for calling JavaScript functions and, most importantly, to call remote methods using what has # been labelled Ajax[http://www.adaptivepath.com/publications/essays/archives/000385.php]. This means that you can call # actions in your controllers without reloading the page, but still update certain parts of it using injections into the # DOM. The common use case is having a form that adds a new element to a list without reloading the page. # - # To be able to use the Javascript helpers, you must either call <%= define_javascript_functions %> (which returns all - # the Javascript support functions in a def javascript_tag(content) content_tag("script", content, :type => "text/javascript") @@ -373,7 +373,7 @@ module ActionView js_options['asynchronous'] = options[:type] != :synchronous js_options['method'] = method_option_to_s(options[:method]) if options[:method] js_options['insertion'] = "Insertion.#{options[:position].to_s.camelize}" if options[:position] - js_options['script'] = options[:script] == true if options[:script] + js_options['evalScripts'] = options[:script] == true if options[:script] if options[:form] js_options['parameters'] = 'Form.serialize(this)' @@ -437,5 +437,7 @@ module ActionView ) end end + + JavascriptHelper = JavaScriptHelper unless const_defined? :JavascriptHelper end end -- cgit v1.2.3