Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rails environment indicator
<% if Rails.env != 'production' %>
document.addEventListener("DOMContentLoaded", function() {
$('body').append($('<div>').css({
display: 'block',
position: 'fixed',
left: '20px',
top: '500px',
'-webkit-transform': 'rotate(-90deg)',
'-moz-transform': 'rotate(-90deg)',
'-o-transform': 'rotate(-90deg)',
'font-size': '24px',
'font-weight': 'bold',
'width': '20px',
'height': '20px'
}).text(window.environment)
);
});
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment