Add method to investments helper to calculate absolute url for investments images. Use it in social share widget.

This commit is contained in:
Senén Rodero Rodríguez
2017-06-24 22:17:27 +02:00
parent 66c1074350
commit cf9a7a21cc
3 changed files with 23 additions and 1 deletions

View File

@@ -1,5 +1,9 @@
module InvestmentsHelper
def investment_image_full_url(investment, version)
URI(request.url) + investment.image.url(version)
end
def investment_image_file_name(investment)
investment.image.url.split('/').last.split("?")[0] if investment.image.present?
end