How can I remove code when my Rails app is in development mode? For example, I want to remove my Google Analytics reference when in development but have it render in the production environment.
Is there a solution that con be implemented in the views or the controllers? I can see a need for both.
<% if Rails.env == 'production' %>
...production code goes here...
<% end %>
This works for Rails 3. In older versions, user the environment variable RAILS_ENV.
Robin