3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/placehold_it/helper.rb', line 3
def placeholder_image_url(size="200x150", *args)
options = args.
options[:bg] = "FFF" if options[:fg].present? && options[:bg].blank?
options[:fg] = "000" if options[:bg].present? && options[:fg].blank?
parts = []
parts << "http://placehold.it"
parts << "/#{size}"
parts << "/#{options[:bg]}" if options[:bg].present?
parts << "/#{options[:fg]}" if options[:fg].present?
parts << "&text=#{options[:text]}" if options[:text].present?
parts.join ""
end
|