Add rel attribute with nofollow value.

This commit is contained in:
Senén Rodero Rodríguez
2017-07-24 18:38:39 +02:00
parent a709cd0479
commit c438e510c0
5 changed files with 33 additions and 11 deletions

View File

@@ -12,6 +12,12 @@ module DocumentsHelper
Hash[Document.sources.map { |k,v| [k, Document.human_attribute_name("document.#{k}")] }]
end
def document_link_url(document)
uri = URI.parse(document.link)
return document.link if uri.scheme == "http" || uri.scheme == "https"
"http://#{document.link}"
end
def bytesToMeg(bytes)
bytes / Numeric::MEGABYTE
end