Sha256: 11cd98b9b1d1a140b478ed30fca5cbcda4d7041d10cc193c7eec7cf985074040

Contents?: true

Size: 525 Bytes

Versions: 5

Compression:

Stored size: 525 Bytes

Contents

module Manage::UsersHelper
  def manage_user_avatar_tag(record, options={})
	  options.symbolize_keys!
		
		type = options.has_key?(:type) ? options.delete(:type).to_sym : nil
		image_type = type.blank? ? "manage/user_pic.gif" : "manage/user_pic_#{type}.gif"
		
		path = (record.nil? || record.avatar.nil?) ? image_type : record.avatar.url(type)
				
		image_title = options.delete(:title)
		image_title ||= record.name unless record.nil?
		options[:title] = options[:alt] = image_title
		
		image_tag path, options
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
freeberry-0.3.0 lib/generators/freeberry/base/templates/helpers/manage/users_helper.rb
freeberry-0.2.9 lib/generators/freeberry/base/templates/helpers/manage/users_helper.rb
freeberry-0.2.7 lib/generators/freeberry/base/templates/helpers/manage/users_helper.rb
freeberry-0.2.6 lib/generators/freeberry/base/templates/helpers/manage/users_helper.rb
freeberry-0.2.5 lib/generators/freeberry/base/templates/helpers/manage/users_helper.rb