toggly-rails
Rails integration for Toggly feature flag management.
Installation
gem 'toggly-rails'
Quick Start
rails generate toggly:install
Then configure in config/initializers/toggly.rb:
Toggly::Rails.configure do |config|
config.app_key = ENV['TOGGLY_APP_KEY']
config.environment = Rails.env.production? ? 'Production' : 'Staging'
end
Usage
Controllers
class DashboardController < ApplicationController
def show
if feature_enabled?(:new_dashboard)
render :new_dashboard
end
end
end
Views
<% if feature_enabled?(:promo) %>
<div class="promo">Special offer!</div>
<% end %>
Documentation
See the main README for full documentation.
License
MIT