* Set up ahoy gem, add ahoy-js * Import ahoy.js into base.js.erb * Add trackNotification function to notifications/index.html.erb * Add sanitized_broadcast_id helper * Use sanitized_broadcast_id in broadcast partial * Add specs around tracking welcome notifications * Remove optional fields from Ahoy::Visit migration + table * Fiddle with trait to see if it helps with CI failures * Disable geocode tracking in ahoy * Stub out SiteConfig in notifications page spec
15 lines
364 B
Ruby
15 lines
364 B
Ruby
module BroadcastsHelper
|
|
def banner_class(broadcast)
|
|
return if broadcast.banner_style.blank?
|
|
|
|
if broadcast.banner_style == "default"
|
|
"crayons-banner"
|
|
else
|
|
"crayons-banner crayons-banner--#{broadcast.banner_style}"
|
|
end
|
|
end
|
|
|
|
def sanitized_broadcast_id(broadcast_title)
|
|
broadcast_title.downcase.delete(":").tr(" ", "_")
|
|
end
|
|
end
|