8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/ads/rails/extensions/action_view/base.rb', line 8
def google_adsense_include_tag(*args)
options = args.
if ::Rails.env.production?
variables = options.map do |key, value|
"google_ad_#{key} = #{value.to_json};"
end
content_tag(
:script,
variables.join("\n").html_safe,
type: 'text/javascript'
) +
content_tag(
:script,
nil,
type: 'text/javascript',
src: "#{request.protocol}pagead2.googlesyndication.com/pagead/show_ads.js"
)
else
instance_exec options, &Ads.configuration.sample_tag
end
end
|