-
gem install letter_avatar然后bundle install -
config/environments/development.rb增加
LetterAvatar.setup do |config|
config.cache_base_path='public/system/lets' # default is 'public/system'
end
生成的图片就在public/system/lets下
-
application_helper中增加
include LetterAvatar::AvatarHelper
-
views中使用letter_avatar_tag(string, pic_size)显示图片
蛮方便的,但不知道占不占用空间,另外生成的图片挺单调的。。。。