README.md in inline_svg-0.6.1 vs README.md in inline_svg-0.6.2

- old
+ new

@@ -2,14 +2,17 @@ Styling a SVG document with CSS for use on the web is most reliably achieved by [adding classes to the document and embedding](http://css-tricks.com/using-svg/) it inline in the HTML. -This gem is a little helper method (`inline_svg`) that reads an SVG document from a Rails -image directory, applies a CSS class attribute to the root of the document and +This gem is a little Rails helper method (`inline_svg`) that reads an SVG document (via Sprockets, so works with the Rails Asset Pipeline), applies a CSS class attribute to the root of the document and then embeds it into a view. +Inline SVG supports [Rails version 4.0.4](http://weblog.rubyonrails.org/2014/3/14/Rails-4-0-4-has-been-released/) and newer. + +Want to embed SVGs with Javascript? You might like [RemoteSvg](https://github.com/jamesmartin/remote-svg), which features similar transforms but can also load SVGs from remote URLs (like S3 etc.). + ## Changelog All notable changes to this project are documented in the [CHANGELOG](https://github.com/jamesmartin/inline_svg/blob/master/CHANGELOG.md). @@ -38,11 +41,11 @@ and fingerprint your SVG files like any other Rails asset. Here's an example of embedding an SVG document and applying a 'class' attribute in HAML: -``` +```haml !!! 5 %html %head %title Embedded SVG Documents %body @@ -52,11 +55,11 @@ ``` Here's some CSS to target the SVG, resize it and turn it an attractive shade of blue: -``` +```css .some-class { display: block; margin: 0 auto; fill: #3498db; width: 5em; @@ -77,10 +80,10 @@ `nocomment` | remove comment tags (and other unsafe/unknown tags) from svg (uses the [Loofah](https://github.com/flavorjones/loofah) gem) `preserve_aspect_ratio` | adds a `preserveAspectRatio` attribute to the SVG Example: -``` +```ruby inline_svg("some-document.svg", id: 'some-id', class: 'some-class', data: {some: "value"}, size: '30% * 20%', title: 'Some Title', desc: 'Some description', nocomment: true, preserve_aspect_ratio: 'xMaxYMax meet') ``` ## Custom Transformations