From 1b865f806147dc1641791ba1a4fe312c13f2e870 Mon Sep 17 00:00:00 2001 From: Jesse Newland Date: Wed, 7 May 2008 09:24:16 -0400 Subject: [PATCH] document passing a block to JavaScriptGenerator#call and JavaScriptGenerator's method_missing proxy to JavaScriptProxy --- .../lib/action_view/helpers/prototype_helper.rb | 30 ++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 81938ac..c1d21b9 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -631,6 +631,27 @@ module ActionView # render(:update) { |page| page.update_time } # end # + # Calls to JavaScriptGenerator not matching a helper method below + # generate a proxy to the JavaScript Class named by the method called. + # + # Examples: + # + # # Generates: + # # Foo.init(); + # update_page do |page| + # page.foo.init + # end + # + # # Generates: + # # Event.observe('one', 'click', function () { + # # $('two').show(); + # # }); + # update_page do |page| + # page.event.observe('one', 'click') do |p| + # p[:two].show + # end + # end + # # You can also use PrototypeHelper#update_page_tag instead of # PrototypeHelper#update_page to wrap the generated JavaScript in a #