Back to Integrations
Ruby on Rails Integration
Add the Pulse script to your application layout with a production environment guard.
Add to your application layout
Use an if guard to only load the script in production.
app/views/layouts/application.html.erb
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<% if Rails.env.production? %>
<script
defer
data-domain="your-site.com"
src="https://pulse.ciphera.net/script.js"
></script>
<% end %>
<title><%= yield(:title) || "My Rails App" %></title>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag "application" %>
</head>
<body>
<%= yield %>
</body>
</html>For more details, see the Rails layout docs.