Sha256: 0834d852f57e1a21694e38461485eed2ff8484208940bcb72431ad494686cf59

Contents?: true

Size: 678 Bytes

Versions: 3

Compression:

Stored size: 678 Bytes

Contents

module ApplicationHelper
  def avatar_for(user, size=32)
    begin
      image_tag "http://www.gravatar.com/avatar.php?gravatar_id=#{MD5.md5(user.email)}&rating=PG&size=#{size}", :size => "#{size}x#{size}", :class => 'photo'
    rescue
      image_tag "http://www.gravatar.com/avatar.php?rating=PG&size=#{size}", :size => "#{size}x#{size}", :class => 'photo'
    end
  end

  def topic_title_link(topic, options)
    if topic.title =~ /^\[([^\]]{1,15})\]((\s+)\w+.*)/
      "<span class='flag'>#{$1}</span>" +
      link_to(h($2.strip), forum_topic_path(@forum, topic), options)
    else
      link_to(h(topic.title), forum_topic_path(@forum, topic), options)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tamed_beast-0.0.3 lib/tamed_beast/application_helper.rb
tamed_beast-0.0.2 lib/tamed_beast/application_helper.rb
tamed_beast-0.0.1 lib/tamed_beast/application_helper.rb