Categories
Rails

Ruby on Rais: rails environments

Code to detect what environment the page is running on, and act accordingly:

<%= debug(params) if Rails.env.development? %>

In the console:

> Rails.env

Will print the environment you are running in: “production”, “test” or “development”

Leave a Reply

Your email address will not be published. Required fields are marked *