[openstreetmap/openstreetmap-website] Prefer string interpolation to concatenation (#2921)

Tom Hughes notifications at github.com
Fri Nov 13 10:55:21 UTC 2020


@tomhughes commented on this pull request.



> @@ -6,7 +6,7 @@ def self.coder
   def set_title(title = nil)
     if title
       @title = TitleHelper.coder.decode(title.gsub("<bdi>", "\u202a").gsub("</bdi>", "\u202c"))
-      response.headers["X-Page-Title"] = ERB::Util.u(@title + " | " + t("layouts.project_name.title"))
+      response.headers["X-Page-Title"] = ERB::Util.u("#{@title} | #{t('layouts.project_name.title')}")

I'd be happy with the format. I suspect you're just not used to seeing the named argument style but we do have other places using it. That said I've merged this and added 45d4242f9d29b00e69aeb016e99a0ce230eb71d9 on top using the variable based approach.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2921#discussion_r522875819
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20201113/a00f9672/attachment.htm>


More information about the rails-dev mailing list