Hi Steven,
Thanks a lot for the support. For anyone who wants to replace
gravatar out of the box here is the changes in the code in the
profile_helper
#Replacement for gravatar
def icon person = nil, size = :small, img_opts = {}
return image_tag(icon_path( person, size)) if person.blank?
link_to(image_tag(icon_path( person, size,
img_opts), :title=>person.f, :alt=>person.f), profile_path(person))
end
def icon_path person = nil, size = :small, img_opts = {}
default = "/images/avatar_default_" + size.to_s + ".png"
debugger;
return default if person.blank?
return default if person.icon.blank?
x = url_for_image_column(person, :icon, size) rescue default
x.blank? ? default : x
end
# Replcing Gravatar with normal image.
#def icon profile, size = :small, img_opts = {}
# return "" if profile.nil?
# img_opts = {:title => profile.full_name, :alt =>
profile.full_name, :class => size}.merge(img_opts)
# link_to(avatar_tag(profile, {:size => size, :file_column_version
=> size }, img_opts), profile_path(profile))
#end
On 30 Jan., 13:56, Steven A Bristol <[email protected]> wrote:
> On Fri, Jan 30, 2009 at 7:51 AM, [email protected]
>
> <[email protected]> wrote:
>
> > Hi Steve,
>
> > Thanks for this comment , now I stumbled upoon another little problem
> > that icon_path is not defined.
> > Do you set it up somewhere?
>
> You may have to modify it a bit, I just pulled this from another app:
>
> def icon_path person = nil, size = :small
>
> default = "/images/unassigned_avatar.png"
> return default if person.blank?
> return "/images/default_avatar.png" if person.icon.blank?
> x = url_for_image_column(person, :icon, size) rescue default
> x.blank? ? default : x
> end
>
> cheers,
> steven bristol
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Lovd by Less" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/lovdbyless?hl=en
Who loves ya baby?
-~----------~----~----~----~------~----~------~--~---