How to run certain lines of code in only production or development mode in Ruby on Rails

Posted on 12 April 2008

Often I don't want to fire off emails to the site admin when I'm testing things on my local machine.

That's when the following comes in really handy...

ENV['RAILS_ENV'] == "production"

Got something to say?