Module: ActionView::Helpers::AssetTagHelper
- Extended by:
- ActiveSupport::Concern
- Includes:
- AssetUrlHelper, TagHelper
- Defined in:
- lib/amelia/action_view/helpers/asset_tag_helper.rb
Overview
This module provides methods for generating HTML that links views to assets such as images, JavaScripts, stylesheets, and feeds. These methods do not verify the assets exist before linking to them:
image_tag("rails.png")
# => <img alt="Rails" src="/assets/rails.png" />
stylesheet_link_tag("application")
# => <link href="/assets/application.css?body=1" media="screen" rel="stylesheet" />
Instance Method Summary collapse
Methods included from TagHelper
Instance Method Details
#javascript_include_tag(*sources) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/amelia/action_view/helpers/asset_tag_helper.rb', line 23 def javascript_include_tag(*sources) = sources..stringify_keys = .extract!('protocol', 'extname').symbolize_keys sources.uniq.map { |source| = { "src" => path_to_javascript(source, ) }.merge!() content_tag(:script, "", , true, false) }.join("\n").html_safe end |