fixes #18: Source/rating not displayed on post pages

This commit is contained in:
albert
2011-09-13 19:17:45 -04:00
parent b166cac19f
commit d954af775e
2 changed files with 11 additions and 1 deletions

View File

@@ -20,4 +20,13 @@ module PostsHelper
nil
end
end
def post_source_tag(post)
if post.source =~ /^http/
text = truncate(post.source.sub(/^https?:\/\//, ""))
link_to(truncate(text, :length => 15), post.source)
else
truncate(post.source, :length => 100)
end
end
end