# feature_gate A gem to help toggle features on and off in Rails applications without having to re-deploy. ## Installation Include gem in Gemfile: gem 'feature_gate' Run generator to create the migration needed rails generate feature_gate Migrate to create the table in your DB: rake db:migrate Add to `config/routes.rb` mount FeatureGate::Engine, at: '/feature_gate' ## Optional Configurations Add `config/initializers/feature_gate.rb` FeatureGate.setup do |config| config.time_to_stale = 2.weeks # time until a gate is listed as stale, default is 1 month. end ## Usage ### Gating features All gates are closed by default, meaning the features you gate will be hidden until you toggle the gates open. In view files (comment in `end` is optional and is just to make it removable via the cleaner): <% FeatureGate::Manager.gate('gate-name') do %>
I am not seen if the gate is on
<% end # gate-name %> In controller actions: def index FeatureGate::Manager.gate_page('gate-name') # 404s if gate is closed end ### Managing gates #### Option 1: UI interface