0.0
No commit activity in last 3 years
No release in over 3 years
Turn features on or off in various rails environments
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

> 4.0.0
 Project Readme

FeatureToggles¶ ↑

Toggle a feature on or off in an environment.

This gem is made to be used in Rails projects.

  1. Add the gem to your project (in Gemfile place gem ‘feature-toggles’)

  2. In your config folder place a file named “feature_toggles.yml”

  3. Set features for various environments like so:

development:
    my_cool_feature:
      enabled: true

    another_feature:
      enabled: true
test:
  my_cool_feature:
    enabled: false

  another_feature:
    enabled: true
  1. require ‘feature_toggles’ #in application.rb after Bundler.require(*Rails.groups)

  2. Test if a feature is enabled like the following:

if FeatureToggles::Feature.is_enabled?(:my_cool_feature)
   render 'my_new_feature' and return
end

And don’t forget to delete your toggles if they’re no longer needed ;)