Sha256: ddf9700896b22adced1e3f7cd83a949f9269dafdf77977470f752fbf606c9873

Contents?: true

Size: 1.32 KB

Versions: 1

Compression:

Stored size: 1.32 KB

Contents

# Holder.js for Rails

[![Build Status](https://travis-ci.org/NARKOZ/holder_rails.png)](https://travis-ci.org/NARKOZ/holder_rails)
[![Gem Version](https://fury-badge.herokuapp.com/rb/holder_rails.png)](http://badge.fury.io/rb/holder_rails)

Provides Holder.js to render image placeholders entirely on the client side.

## Installation

Add to your Gemfile:

```ruby
gem 'holder_rails'
```

and run:

```sh
bundle install
```

## Usage

Add to your JavaScript manifest file:

```js
//= require holder
```

You can use `holder_tag` helper in your views:

```ruby
holder_tag 100
# => <img data-src="holder.js/100x100/text:100x100/" src="" />

holder_tag '200x300'
# => <img data-src="holder.js/200x300/text:200x300/" src="" />

holder_tag '200x300', 'Lorem ipsum'
# => <img data-src="holder.js/200x300/text:Lorem ipsum/" src="" />

holder_tag '200x300', 'Lorem ipsum', 'social'
# => <img data-src="holder.js/200x300/text:Lorem ipsum/social" src="" />

holder_tag '500x800', 'Example text', 'gray', :id => 'new', :class => 'special'
# => <img class="special" data-src="holder.js/500x800/text:Example text/gray" id="new" src="" />
```

For more information, check out [holder readme](https://github.com/imsky/holder#readme).

## Versioning

holder_rails 1.7.0 == Holder.js 1.7

## License

Released under the BSD 2-clause license. See LICENSE.txt for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
holder_rails-1.9.0 README.md