Project

General

Profile

Actions

Patch #40087

closed

Rewrite ApplicationHelper#favicon_url method using image_url

Added by Go MAEDA 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

This change deals with the comment "TODO: use #image_url introduced in Rails4" in ApplicationHelper#favicon_url.

diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index a82163b76..4d87f6075 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1759,10 +1759,7 @@ module ApplicationHelper

   # Returns the full URL to the favicon
   def favicon_url
-    # TODO: use #image_url introduced in Rails4
-    path = favicon_path
-    base = url_for(:controller => 'welcome', :action => 'index', :only_path => false)
-    base.sub(%r{/+$}, '') + '/' + path.sub(%r{^/+}, '')
+    image_url(favicon_path)
   end

   def robot_exclusion_tag
Actions #1

Updated by Marius BĂLTEANU 3 months ago

  • Status changed from New to Closed
  • Assignee set to Marius BĂLTEANU

Committed, thanks!

Actions

Also available in: Atom PDF