Skip to content

Instantly share code, notes, and snippets.

@shageman
Created September 1, 2012 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shageman/3589540 to your computer and use it in GitHub Desktop.
Save shageman/3589540 to your computer and use it in GitHub Desktop.
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