Class: ActionView::Helpers::AssetTagHelper::AssetIncludeTag
- Inherits:
-
Object
- Object
- ActionView::Helpers::AssetTagHelper::AssetIncludeTag
- Includes:
- TagHelper
- Defined in:
- actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb
Direct Known Subclasses
Constant Summary
Constant Summary
Constants included from TagHelper
TagHelper::BOOLEAN_ATTRIBUTES, TagHelper::PRE_CONTENT_STRINGS
Instance Attribute Summary (collapse)
-
- (Object) asset_paths
readonly
Returns the value of attribute asset_paths.
-
- (Object) config
readonly
Returns the value of attribute config.
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) asset_name
- - (Object) asset_tag(source, options)
- - (Object) custom_dir
- - (Object) extension
- - (Object) include_tag(*sources)
-
- (AssetIncludeTag) initialize(config, asset_paths)
constructor
A new instance of AssetIncludeTag.
Methods included from TagHelper
#cdata_section, #content_tag, #escape_once, #tag
Methods included from ActiveSupport::Concern
#append_features, extended, #included
Methods included from CaptureHelper
#capture, #content_for, #content_for?, #flush_output_buffer, #provide, #with_output_buffer
Constructor Details
- (AssetIncludeTag) initialize(config, asset_paths)
A new instance of AssetIncludeTag
20 21 22 23 |
# File 'actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb', line 20 def initialize(config, asset_paths) @config = config @asset_paths = asset_paths end |
Instance Attribute Details
- (Object) asset_paths (readonly)
Returns the value of attribute asset_paths
13 14 15 |
# File 'actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb', line 13 def asset_paths @asset_paths end |
- (Object) config (readonly)
Returns the value of attribute config
13 14 15 |
# File 'actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb', line 13 def config @config end |
Class Method Details
+ (Object) inherited(base)
16 17 18 |
# File 'actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb', line 16 def self.inherited(base) base.expansions = { } end |
Instance Method Details
- (Object) asset_name
25 26 27 |
# File 'actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb', line 25 def asset_name raise NotImplementedError end |
- (Object) asset_tag(source, options)
37 38 39 |
# File 'actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb', line 37 def asset_tag(source, ) raise NotImplementedError end |
- (Object) custom_dir
33 34 35 |
# File 'actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb', line 33 def custom_dir raise NotImplementedError end |
- (Object) extension
29 30 31 |
# File 'actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb', line 29 def extension raise NotImplementedError end |
- (Object) include_tag(*sources)
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb', line 41 def include_tag(*sources) = sources..stringify_keys concat = .delete("concat") cache = concat || .delete("cache") recursive = .delete("recursive") if concat || (config.perform_caching && cache) joined_name = (cache == true ? "all" : cache) + ".#{extension}" joined_path = File.join((joined_name[/^#{File::SEPARATOR}/] ? config.assets_dir : custom_dir), joined_name) unless config.perform_caching && File.exists?(joined_path) write_asset_file_contents(joined_path, compute_paths(sources, recursive)) end asset_tag(joined_name, ) else sources = (sources, recursive) ensure_sources!(sources) if cache sources.collect { |source| asset_tag(source, ) }.join("\n").html_safe end end |