1
0
Fork 0
forked from OpenNeo/impress
impress/app/helpers/items_helper.rb

13 lines
431 B
Ruby
Raw Normal View History

2010-05-15 10:47:46 -07:00
module ItemsHelper
StandardSpeciesImageFormat = 'http://pets.neopets.com/cp/%s/1/1.png'
def standard_species_images
colors = Species::StandardColors
raw(Species.all.inject('') do |html, species|
color = colors[rand(colors.size)]
src = sprintf(StandardSpeciesImageFormat, species.hash_for_color(color))
html + image_tag(src, 'data-color' => color, 'data-species' => species.name)
end)
end
2010-05-15 10:47:46 -07:00
end