Method: Helperful::AssetTagHelper#javascript
- Defined in:
- lib/helperful/asset_tag_helper.rb
#javascript(*files) ⇒ Object
Converts given files in javascript include statements and appends them in the head section of the page.
Examples
# in your index.html.erb view
<% javascript :foo, :bar, :cache => "foobar" %>
# this is equivalent to
<% content_for :head, javascript_include_tag(:foo, :bar, :cache => "foobar") %>
# in your application
<% yield :head %>
82 83 84 |
# File 'lib/helperful/asset_tag_helper.rb', line 82 def javascript(*files) content_for(:head, javascript_include_tag(*files)) end |