]> git.openstreetmap.org Git - rails.git/commitdiff
Use image_url instead of image_path with the host option
authorTom Hughes <tom@compton.nu>
Thu, 24 Nov 2016 20:23:42 +0000 (20:23 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 24 Nov 2016 20:23:42 +0000 (20:23 +0000)
Fixes #1379

app/helpers/open_graph_helper.rb
app/views/changeset/list.atom.builder
app/views/diary_entry/rss.rss.builder
app/views/trace/georss.rss.builder

index e21a5648a7c3be9f4482855d657381215915b076..ac1a572196499f043f224c5a3b39873b72b0381e 100644 (file)
@@ -4,8 +4,8 @@ module OpenGraphHelper
       "og:site_name" => t("layouts.project_name.title"),
       "og:title" => [t("layouts.project_name.title"), title].compact.join(" | "),
       "og:type" => "website",
-      "og:image" => image_path("osm_logo_256.png", :host => SERVER_URL, :protocol => "http"),
-      "og:image:secure_url" => image_path("osm_logo_256.png", :host => SERVER_URL, :protocol => "https"),
+      "og:image" => image_url("osm_logo_256.png", :protocol => "http"),
+      "og:image:secure_url" => image_url("osm_logo_256.png", :protocol => "https"),
       "og:url" => url_for(:host => SERVER_URL),
       "og:description" => t("layouts.intro_text")
     }
index 7871413897210b1361c1719f21f19fef8a61a8d4..68b4a198505b6204af025356f8a964a538097308 100644 (file)
@@ -5,12 +5,12 @@ atom_feed(:language => I18n.locale, :schema_date => 2009,
   feed.title changeset_list_title(params, @user)
 
   feed.updated @edits.map { |e| [e.created_at, e.closed_at].max }.max
-  feed.icon image_path("favicon.ico", :host => SERVER_URL)
-  feed.logo image_path("mag_map-rss2.0.png", :host => SERVER_URL)
+  feed.icon image_url("favicon.ico")
+  feed.logo image_url("mag_map-rss2.0.png")
 
   feed.rights :type => "xhtml" do |xhtml|
     xhtml.a :href => "http://creativecommons.org/licenses/by-sa/2.0/" do |a|
-      a.img :src => image_path("cc_button.png", :host => SERVER_URL), :alt => "CC by-sa 2.0"
+      a.img :src => image_url("cc_button.png"), :alt => "CC by-sa 2.0"
     end
   end
 
index 8a6915bf1ee82453787cd482d38d4d805065d934..6d1b1def4e80733889915b82df64f40679bf6079 100644 (file)
@@ -9,7 +9,7 @@ xml.rss("version" => "2.0",
     xml.description @description
     xml.link url_for(:action => "list", :host => SERVER_URL)
     xml.image do
-      xml.url image_path("mag_map-rss2.0.png", :host => SERVER_URL)
+      xml.url image_url("mag_map-rss2.0.png")
       xml.title @title
       xml.width "100"
       xml.height "100"
index 6d3aeebe022d9b6d32dccef09abf2a47ebf3c6a2..8470e85cbedb234fc10b1fa0b25604c1504314ce 100644 (file)
@@ -10,7 +10,7 @@ xml.rss("version" => "2.0",
     xml.link url_for(:controller => :trace, :action => :list, :only_path => false)
 
     xml.image do
-      xml.url image_path("mag_map-rss2.0.png", :host => SERVER_URL)
+      xml.url image_url("mag_map-rss2.0.png")
       xml.title t("trace.georss.title")
       xml.width 100
       xml.height 100