Skip to content

Commit

Permalink
Merge pull request rails#38568 from gmcgibbon/rewrite_js_tag_example
Browse files Browse the repository at this point in the history
Use type attribute in ActionView::Helpers::JavaScriptHelper#javascript_tag example
  • Loading branch information
gmcgibbon authored Feb 25, 2020
2 parents 79ba069 + eaa33bb commit ecaed2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actionview/lib/action_view/helpers/javascript_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ def escape_javascript(javascript)
# +html_options+ may be a hash of attributes for the <tt>\<script></tt>
# tag.
#
# javascript_tag "alert('All is good')", defer: 'defer'
# javascript_tag "alert('All is good')", type: 'application/javascript'
#
# Returns:
# <script defer="defer">
# <script type="application/javascript">
# //<![CDATA[
# alert('All is good')
# //]]>
Expand All @@ -61,7 +61,7 @@ def escape_javascript(javascript)
# Instead of passing the content as an argument, you can also use a block
# in which case, you pass your +html_options+ as the first parameter.
#
# <%= javascript_tag defer: 'defer' do -%>
# <%= javascript_tag type: 'application/javascript' do -%>
# alert('All is good')
# <% end -%>
#
Expand Down

0 comments on commit ecaed2e

Please sign in to comment.