Sha256: c32e769ac56401fd2af8cf5335e844c2531c3dde8f928e6c77766cfe8642dd18

Contents?: true

Size: 374 Bytes

Versions: 28

Compression:

Stored size: 374 Bytes

Contents

module Esvg::Helpers

  def embed_svgs(*keys)
    if Rails.env.production?
      Esvg.build_paths(keys).map { |path| javascript_include_tag(path, async: true) }.join("\n").html_safe
    else
      Esvg.embed(keys)
    end
  end

  def use_svg(name, options={}, &block)
    options[:content] = capture(&block).html_safe if block_given?

    Esvg.use(name, options)
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
esvg-4.6.11 lib/esvg/helpers.rb
esvg-4.6.10 lib/esvg/helpers.rb
esvg-4.6.9 lib/esvg/helpers.rb
esvg-4.6.8 lib/esvg/helpers.rb
esvg-4.6.7 lib/esvg/helpers.rb
esvg-4.6.6 lib/esvg/helpers.rb
esvg-4.6.5 lib/esvg/helpers.rb
esvg-4.6.4 lib/esvg/helpers.rb
esvg-4.6.3 lib/esvg/helpers.rb
esvg-4.6.2 lib/esvg/helpers.rb
esvg-4.6.1 lib/esvg/helpers.rb
esvg-4.6.0 lib/esvg/helpers.rb
esvg-4.5.0 lib/esvg/helpers.rb
esvg-4.4.3 lib/esvg/helpers.rb
esvg-4.4.2 lib/esvg/helpers.rb
esvg-4.4.1 lib/esvg/helpers.rb
esvg-4.4.0 lib/esvg/helpers.rb
esvg-4.3.9 lib/esvg/helpers.rb
esvg-4.3.8 lib/esvg/helpers.rb
esvg-4.3.7 lib/esvg/helpers.rb