From 6d0c7bc2349cc9d31eb8e25a5c0ffb61737b01df Mon Sep 17 00:00:00 2001 From: Frank Lakatos Date: Thu, 27 May 2010 15:41:15 -0400 Subject: [PATCH] Added function js() to alias escape_javascript as a convenient short hand in js.html files ... <%=js render :partial => 'foo' -%> --- .../lib/action_view/helpers/javascript_helper.rb | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 2ed9d23..2740060 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -145,6 +145,9 @@ module ActionView '' end end + + # alias so you can do <%=js render :partial => "some/partial" -%> + alias js escape_javascript # Returns a JavaScript tag with the +content+ inside. Example: # javascript_tag "alert('All is good')" -- 1.7.0.3