Manage Rails Feature Flags with Ease

Reduce risk, iterate quicker, and get more control with LaunchDarkly
Rails feature flag management. Try it out free with a 30-day trial.

Try It Free
Feature flag lifecycle management
technical debt
Manage feature flags at enterprise scale across multiple dev environments with flag statuses, audit logging, and custom roles.
Feature toggle user and performance feedback
Release faster
with less risk
Reduce risk to customer impact by releasing to limited user segments and testing your infrastructure behind feature flags.
Feature flags kill switch and feature toggles
Central platform
for controlling features
LaunchDarkly’s user interface allows non-technical users to control user targeting and implement feature flagging best practices.

Ruby on Rails Feature Flags

Let's create a Ruby feature flag for a "One Click Checkout"

1.Install the SDK with gem

Check out our open source Ruby SDK on GitHub or read through the reference documentation.

       gem install ldclient-rb

2.Create a new LaunchDarkly client

       ld_client ="YOUR_SDK_KEY")

3.Create a feature flag in LaunchDarkly

A flag allows you to manage a feature from the LaunchDarkly dashboard.

4.Wrap your code with a feature flag

First, create a user.  You can pass us any data about users for targeting and segmentation. 
Then, call variation and see whether the flag is on for that user.

        user = {
          key: "",
          firstName: "Bob",
          lastName: "Loblaw",
          custom: {
            groups: "beta_testers"

        if ld_client.variation("one_click_checkout", user, false)
          # showing one click checkout
          puts "Showing your feature to #{user[:key]}"
          # the code to run if the feature is off
          puts "Not showing your feature to #{user[:key]}"

5.Manage your flag

Use LaunchDarkly to determine which users see the feature.
You can roll out to a percentage of your users or target individual users/groups.

  • LaunchDarkly Testimonial
    I believe that feature flags are a critical piece of modern development, and LaunchDarkly brings this part of continuous delivery to the masses.
    - Rob Zuber, CTO, CircleCI
    LaunchDarkly Testimonial
    LaunchDarkly has been easy to on-board and integrate into our existing development cycle, which has helped us move faster with less risk.
    - Lawrence, VP Engineering, Ten-X

Try LaunchDarkly free for 30 days.

Continuously deliver and deploy software to your users in a faster, more reliable way. Get started today with a 30 day free trial.