From adc90a5bb1b324fa03b226612bf94269c9f08b8e Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Mon, 18 Dec 2017 09:50:05 -0400 Subject: [PATCH] Add 'image_url' SEO properties to Proposal & Budget::Investment 'show' views --- app/views/budgets/investments/_investment_show.html.erb | 9 +++++++++ app/views/proposals/show.html.erb | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index fc42e1a3a26..946952bd9e5 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -1,3 +1,12 @@ +<% provide :social_media_meta_tags do %> +<%= render "shared/social_media_meta_tags", + social_url: budget_investments_path(investment), + social_title: investment.title, + social_description: investment.description, + twitter_image_url: (investment.image.present? ? investment.image_url(:thumb) : nil), + og_image_url: (investment.image.present? ? investment.image_url(:thumb) : nil) %> +<% end %> +
diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index d028a3f7f12..dbeb110ce02 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -4,7 +4,9 @@ <%= render "shared/social_media_meta_tags", social_url: proposal_url(@proposal), social_title: @proposal.title, - social_description: @proposal.summary %> + social_description: @proposal.summary, + twitter_image_url: (@proposal.image.present? ? @proposal.image_url(:thumb) : nil), + og_image_url: (@proposal.image.present? ? @proposal.image_url(:thumb) : nil) %> <% end %> <% content_for :canonical do %> <%= render "shared/canonical", href: proposal_url(@proposal) %>