# Auto Sprite 1.0

**URL:** <https://discuss.rubyonrails.org/t/auto-sprite-1-0/48486>\
**Category:** rubyonrails-talk\
**Created:** [January 11, 2010, 3:59am UTC](https://discuss.rubyonrails.org/t/auto-sprite-1-0/48486 "2010-01-11T03:59:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Stephen](https://discuss.rubyonrails.org/u/Stephen)\
**Post date:** [January 11, 2010, 3:59am UTC](https://discuss.rubyonrails.org/t/auto-sprite-1-0/48486/1 "2010-01-11T03:59:24Z")

</div>

Hi all,

Just want to announce my auto\_sprite gem which some of you may find handy… It makes using CSS sprites painless. As a bonus - should you remove it some day, it doesn’t break you app, it just reverts to ![]() tags…

Full docs are at [http://fargle.org/auto\_sprite](http://fargle.org/auto_sprite)

In a pinch:

1. Include the stylesheet in your layout:

```ruby
<%= stylesheet_link_tag "auto_sprite" %>

```

1. Create a directory called sprites in your images directory (e.g. RAILS\_ROOT/public/images/sprites)

2. Put the images you want to link to in your public/images/sprites directory.

3. Use your images like you normally would: \<%= image\_tag ‘sprites/logo.png’ %\> \<%= image\_tag ‘sprites/icon1.jpg’ %\>

4. Reload you application and enjoy your now faster website.

Enjoy! Stephen

---

<div class="post-metadata">

**Author:** ![Stephen](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Stephen](https://discuss.rubyonrails.org/u/Stephen)\
**Post date:** [January 13, 2010, 10:23pm UTC](https://discuss.rubyonrails.org/t/auto-sprite-1-0/48486/2 "2010-01-13T22:23:30Z")

</div>

Just curious - did anyone try this out with success/failure? Thx.

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 13, 2010, 10:33pm UTC](https://discuss.rubyonrails.org/t/auto-sprite-1-0/48486/3 "2010-01-13T22:33:46Z")

</div>

Stephen wrote:

> Just curious - did anyone try this out with success/failure? Thx.

Not yet, but I'll have to try. This looks very interesting!

Best,

---

<div class="post-metadata">

**Author:** ![Stephen](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Stephen](https://discuss.rubyonrails.org/u/Stephen)\
**Post date:** [January 16, 2010, 5:30pm UTC](https://discuss.rubyonrails.org/t/auto-sprite-1-0/48486/4 "2010-01-16T17:30:21Z")

</div>

I do use this in a live project - its not just a “hey wouldn’t this be cool moment” =)

Would love to hear feedback/suggestions if anyone has some to share…
