Follow Along as I Stumble on the Path to Learning RoR

Limiting Code to an Environment

I had to limit some code (an initializer) to just being used in production, but didn’t know how to do it. In rails 3, you can do this:

if Rails.env.production?
your code
end

Advertisements

Comments are closed.