diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascript_helper.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 3f0a462092..3a5aaa6412 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -153,7 +153,15 @@ module ActionView end # Returns a JavaScript tag with the +content+ inside. Example: - # javascript_tag "alert('All is good')" # => <script type="text/javascript">alert('All is good')</script> + # javascript_tag "alert('All is good')" + # + # Returns: + # + # <script type="text/javascript"> + # //<![CDATA[ + # alert('All is good') + # //]]> + # </script> def javascript_tag(content) content_tag("script", javascript_cdata_section(content), :type => "text/javascript") end |