Module: RailsIcons::Helpers::SpriteHelper
- Defined in:
- lib/rails_icons/helpers/sprite_helper.rb
Instance Method Summary collapse
-
#icons_sprite(icons = nil, library: nil, variant: nil) ⇒ ActiveSupport::SafeBuffer
Returns the inline SVG sprite content containing all symbols.
-
#sprite_icon(name, library: nil, variant: nil, sprite_location: nil, **arguments) ⇒ ActiveSupport::SafeBuffer
Renders an SVG icon from a sprite, compatible with Rails Icons API.
Instance Method Details
#icons_sprite(icons = nil, library: nil, variant: nil) ⇒ ActiveSupport::SafeBuffer
Returns the inline SVG sprite content containing all symbols
47 48 49 |
# File 'lib/rails_icons/helpers/sprite_helper.rb', line 47 def icons_sprite(icons = nil, library: nil, variant: nil) Icons::Sprite.new(icons: icons, library: library, variant: variant).svg.html_safe end |
#sprite_icon(name, library: nil, variant: nil, sprite_location: nil, **arguments) ⇒ ActiveSupport::SafeBuffer
Renders an SVG icon from a sprite, compatible with Rails Icons API
24 25 26 27 28 29 30 31 32 |
# File 'lib/rails_icons/helpers/sprite_helper.rb', line 24 def sprite_icon(name, library: nil, variant: nil, sprite_location: nil, **arguments) Icons::SpriteIcon.new( name: name, library: library || RailsIcons.configuration.default_library, variant: variant, sprite_location: sprite_location, arguments: arguments ).svg.html_safe end |