Files
grecia/app/helpers/tracks_helper.rb
Javi Martín 66759d2dc0 Apply StringConcatenation rule in some places
This rule was added in Rubocop 0.89.0. However, there are some false
positives when we don't use interpolation but simply concatenate in
order to avoid long lines. Even if there weren't false positives, there
are places where we concatenate to emphasize the point that we're adding
a certain character to a text.

We might reconsider this rule in the future, since we generally prefer
interpolation over concatenation.
2020-10-23 12:01:39 +02:00

13 lines
268 B
Ruby

module TracksHelper
def track_event(data = {})
track_data = ""
prefix = " data-track-event-"
data.each do |key, value|
track_data = "#{track_data}#{prefix}#{key}=#{value} "
end
content_for :track_event do
track_data
end
end
end