0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A lightweight gem to facilitate use of image placeholders from placehold.it
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

PlaceholdIt

Rails helpers for easy image placeholders from Placehold.It.

Examples

Generating a URL

#(1) Default Arguments
placeholder_image_url
#(2) 350x350 image
placeholder_image_url 350
#(3) 350x450 image, with a red (#FF0000) background 
placeholder_image_url "350x450", :bg => "FF0000"
#(4) 350x350 image with a black (#000) background and dark grey (#666) text
placeholder_image_url "350x350", :bg => "000", :fg => "666"
#(5) 350x350 image with text "Args in any order", a black (#000) background and dark grey (#666) text
placeholder_image_url "350x350", :text => "Args in any order", :bg => "000", :fg => "666"
#(6) 500x50 image with text "Jackdaws love my big sphinx of quartz."
placeholder_image_url "500x50", :text => "Jackdaws love my big sphinx of quartz."

Inserting a tag

it's much the same as the placeholder_image_url method, except that you can add some html options

#Default Arguments
placeholder_image_tag "300x450", #size
  { :class => "my_image_class", :id => "special_img"}, # html element options
  :text => "This is a test" # followed by the options described above for placeholder_image_url

Thanks

Credit goes to Brent Spore for making Placehold.It and keeping it free, and to Zeke Sikelianos for writing the little piece of code that inspired this gem.