Module: ActionView::Helpers::AssetTagHelper
- Defined in:
- lib/lessr/asset_tag_helper.rb
Instance Method Summary collapse
- #expand_less_sources(sources, recursive) ⇒ Object
- #less_link_tag(*sources) ⇒ Object
- #less_tag(source, options) ⇒ Object
Instance Method Details
#expand_less_sources(sources, recursive) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/lessr/asset_tag_helper.rb', line 10 def (sources, recursive) if sources.first == :all collect_asset_files(config.stylesheets_dir, ('**' if recursive), '*.less') else sources.collect do |source| determine_source(source, @@stylesheet_expansions) end.flatten end end |
#less_link_tag(*sources) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/lessr/asset_tag_helper.rb', line 2 def less_link_tag(*sources) = sources..stringify_keys recursive = .delete("recursive") sources = (sources, recursive).collect { |source| compute_public_path(source, 'stylesheets', 'less', false) } sources.collect { |source| less_tag(source, ) }.join("\n").html_safe end |
#less_tag(source, options) ⇒ Object
20 21 22 |
# File 'lib/lessr/asset_tag_helper.rb', line 20 def less_tag(source, ) tag("link", { "rel" => "stylesheet/less", "type" => Mime::CSS, "media" => "screen", "href" => html_escape(path_to_stylesheet(source)) }.merge(), false, false) end |