Module: Codeleaf::DummyContentHelper
- Defined in:
- lib/codeleaf/helpers/dummy_content_helper.rb
Instance Method Summary collapse
Instance Method Details
#placeholder_img(width = 100, height = 100, color = "", kitten = false) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/codeleaf/helpers/dummy_content_helper.rb', line 3 def placeholder_img(width = 100, height = 100, color = "", kitten = false) if color == "" 6.times do color << ['a', 'b', 'c', 'd', 'e'].sample end end if kitten return "http://placekitten.com/g/#{width}/#{height}" else return "http://placehold.it/#{width}x#{height}/#{color}" end end |