Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7961955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:11:49+00:00 2026-06-04T05:11:49+00:00

Im curious how you guys visual make distinction between the different Rails modes development/test

  • 0

Im curious how you guys visual make distinction between the different Rails modes development/test and production?

Im afraid that since visually the apps look the same in each mode, my customer can use the wrong environment and enter production data in a test environment.

Now i change the background in my application CSS, to make sure there is a difference. BUt i rather would have something smart that automatically works based on the environment thats running. Maybe a BIG watermark?

Any best practices here?

Based on Artimuz answer i did the following:

Add this to the application_helper.rb

  def development?
    @is_development ||= (ENV['RAILS_ENV'] != 'production')
  end

then in application.html.erb i added:

 <head>
 <% if development? %>
    <style type="text/css">
        html {              
         background-image: url(/assets/test.png);
         background-color: silver;
        }
    </style>>   
  <% end %>
 </head>

The test.png is just a transparent png with the word ‘test’ inside and a diagonal line. Works like a charm (its tiled), for sure you you can’t miss your inside the development/test environment.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:11:50+00:00Added an answer on June 4, 2026 at 5:11 am

    From here: http://markmail.org/message/grmor6rppm5jwgnh

    You can test RAILS_ENV environment variable.

    In application_helper.rb, add this method :

    def production?
      @is_production ||=(ENV['RAILS_ENV']=='production')
    end
    

    An d in your views/layouts:

    <% if production? %>
       ...
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright guys, I really hurt my brain over this one and I'm curious if
Curious as to the inode data structure differences between 128-byte ext2 and 256-byte ext3
I'm just curious and was wondering how you guys handle it if you want
Am curious why modern browsers allow switching off Javascript. It's so clear now that
I'm curious, why did Sun decide to make the JVM stack-based and Google decide
I've always been curious about this. Between the two code example which is more
Curious as to how to approach this same problem using ruby / rails -
Curious: Why is it that Foundation on OS X contains a wrapper for CFHost
Do you guys know of any algorithms that can be used to compute difference
Just curious: sure, we all know that the general case of type inference for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.