Auto Sprite 1.0

16 views
Skip to first unread message

Stephen

unread,
Jan 10, 2010, 10:59:24 PM1/10/10
to rubyonra...@googlegroups.com
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 <img> tags..

Full docs are at http://fargle.org/auto_sprite


In a pinch:

  1. Include the stylesheet in your layout:
         <%= stylesheet_link_tag "auto_sprite" %>
  2. Create a directory called sprites in your images directory (e.g. RAILS_ROOT/public/images/sprites)
  3. Put the images you want to link to in your public/images/sprites directory.
  4. Use your images like you normally would:

    <%= image_tag ‘sprites/logo.png’ %>
    <%= image_tag ‘sprites/icon1.jpg’ %>

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

Enjoy!
Stephen

Stephen

unread,
Jan 13, 2010, 5:23:30 PM1/13/10
to Ruby on Rails: Talk
Just curious - did anyone try this out with success/failure? Thx.


On Jan 10, 10:59 pm, Stephen <sblackst...@gmail.com> wrote:
> 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 <img> tags..
>
> Full docs are athttp://fargle.org/auto_sprite
>
> In a pinch:
>

>    1. Include the stylesheet in your layout:
>
>         <%= stylesheet_link_tag "auto_sprite" %>
>
>    2. Create a directory called sprites in your images directory (e.g.
>    RAILS_ROOT/public/images/sprites)
>    3. Put the images you want to link to in your public/images/sprites
>    directory.
>    4. Use your images like you normally would:


>
>    <%= image_tag ‘sprites/logo.png’ %>
>    <%= image_tag ‘sprites/icon1.jpg’ %>

>    5. Reload you application and enjoy your now faster website.
>
> Enjoy!
> Stephen

Marnen Laibow-Koser

unread,
Jan 13, 2010, 5:33:46 PM1/13/10
to rubyonra...@googlegroups.com
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,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
--
Posted via http://www.ruby-forum.com/.

Stephen

unread,
Jan 16, 2010, 12:30:21 PM1/16/10
to rubyonra...@googlegroups.com
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.. 


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




Reply all
Reply to author
Forward
0 new messages