Skip to content

Instantly share code, notes, and snippets.

@maylogger
Created September 21, 2012 05:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maylogger/3759884 to your computer and use it in GitHub Desktop.
Save maylogger/3759884 to your computer and use it in GitHub Desktop.
貓假圖
module ViewHelpers
def placekitten(size, options={})
domain = options[:domain] || "http://placekitten.com"
src = "#{domain}/#{size}?image=#{rand(16)+1}"
g = options[:g]
if options[:g]
src = "#{domain}/g/#{size}?image=#{rand(16)+1}"
end
src
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment