dtaniwaki/rack-dev-mark

How can I also add another environment apart from development?

kithokit opened this issue · 2 comments

How can I also add another environment apart from development?
e.g., qa, staging etc?

Thank you for using my gem.

To show the ribbon in those environments, you can add the following code in config/application.rb. It means "show the ribbon in any environments except production".

module MyApp
  class Application < Rails::Application
    config.rack_dev_mark.enable = !Rails.env.production?
  end
end

To hide the ribbon in production and those environments, add the following in config/application.rb.

module MyApp
  class Application < Rails::Application
    config.rack_dev_mark.enable = !%w(qa staging production).include?(Rails.env)
  end
end

Does it cover your question?

Thanks a lot. The question is solved!