Skip to content

dprabu17/lorempixel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lorempixel

A Rails view helper for placeholder images via http://lorempixel.com

Installation

Add this line to your application's Gemfile:

gem 'lorempixel'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lorempixel

Usage

to get a random picture of 400 x 400 pixels

<%= lorempixel_image_tag "400" %>

to get a random picture of 400 x 200 pixels

<%= lorempixel_image_tag "400x200" %>

to get a random gray picture of 400 x 400 pixels

<%= lorempixel_image_tag "400" , :type => "g"%>

to get a random picture of the any category given below:

[abstract , animals, business, cats, city, food, nightlife, fashion, people, nature, sports, technics, transport ]

<%= lorempixel_image_tag "400", :category => "sports" %>

to get picture no. 1/10 from the sports category

<%= lorempixel_image_tag "400", :category => "sports", :item => 1 %>

...with a custom text on the random Picture

<%= lorempixel_image_tag "400", :category => "sports", :text => "Dummy-Text" %>

...with a custom text on the selected Picture

<%= lorempixel_image_tag "400x200", :category => "sports", :item => 1, :text => "Dummy-Text" %>

Alternatively, calling lorempixel will work as well:

<%= lorempixel "400" %>

Testing

rspec spec/

Contributing

Fork it
Create your feature branch (git checkout -b my-new-feature)
Commit your changes (git commit -am 'Add some feature')
Push to the branch (git push origin my-new-feature)
Create new Pull Reques

About

A Rails view helper for lorempixel images via http://lorempixel.com

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages