In order to easily distinguish between production and staging web site, I would like to apply different CSS styles, based on the Rails environment.
What is the best way to accomplish this please?
In order to easily distinguish between production and staging web site, I would like to apply different CSS styles, based on the Rails environment.
What is the best way to accomplish this please?
You can use Rails.env.production? and add some class to div, body etc... If you want to do it global in you application layout add something like:
<!-- application_layout -->
<body class="<%= Rails.env.production? ? 'prod-class' : 'dev-class' %>">
</body>
If is only for some div or element:
<div class="<%= Rails.env.production? ? 'prod-class' : 'dev-class' %>">
</div>