I want to load jQuery UI via Google CDN if in production and locally if in development. So in my application.html.erb layout, I've got to know whether I'm in production or dev. Is there a variable I can check?
To expand a bit on Paritosh's answer, Rails.env.production?
and Rails.env.development?
will return true/false depending on which environment you're using.
These methods are defined in the StringInquirer
class in the ActiveSupport
module. See them here.