{"id":20345437,"url":"https://github.com/flippercloud/flipper-rails-demo","last_synced_at":"2025-04-12T00:40:57.466Z","repository":{"id":26721531,"uuid":"92780314","full_name":"flippercloud/flipper-rails-demo","owner":"flippercloud","description":"Basic Rails application running Flipper Cloud","archived":false,"fork":false,"pushed_at":"2024-05-16T21:51:48.000Z","size":607,"stargazers_count":9,"open_issues_count":12,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-25T20:21:53.884Z","etag":null,"topics":["feature","feature-flags","feature-toggle","feature-toggles","flipper","flipper-cloud","rails"],"latest_commit_sha":null,"homepage":"https://playground.flippercloud.io","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flippercloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-29T22:38:29.000Z","updated_at":"2024-02-01T17:01:23.000Z","dependencies_parsed_at":"2023-12-05T18:35:48.060Z","dependency_job_id":"b1e4c1d2-0d88-43bb-a6a7-3943231c1ebd","html_url":"https://github.com/flippercloud/flipper-rails-demo","commit_stats":null,"previous_names":["flippercloud/flipper-rails-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flippercloud%2Fflipper-rails-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flippercloud%2Fflipper-rails-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flippercloud%2Fflipper-rails-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flippercloud%2Fflipper-rails-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flippercloud","download_url":"https://codeload.github.com/flippercloud/flipper-rails-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501960,"owners_count":21114681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["feature","feature-flags","feature-toggle","feature-toggles","flipper","flipper-cloud","rails"],"created_at":"2024-11-14T22:08:32.041Z","updated_at":"2025-04-12T00:40:57.438Z","avatar_url":"https://github.com/flippercloud.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flipper Rails Playground\n\nThis is an example Rails application that serves as a playground and working demo to walk you through the basics of using Flipper. You can run the playground and interact with the feature toggles, or you can browse the source code to see the commands for toggling features.\n\n## Automated Setup (Fast and Easy)\n\nOnce you've pulled down the repo, you should be able to run `bin/setup`, and the application will bootstrap everything for you.\n\n```bash\n$ bin/setup\n```\n\nThis app already has the pre-requisites setup and ready to go.\n\n## Manual Setup (See how it all works!)\n\n1. Copy over the sample `.env` file\n\n```bash\n$ cp .env.example .env\n```\n\n1. Get your `FLIPPER_CLOUD_TOKEN` by going to your project's \"Tokens\" page in [Flipper Cloud](https://www.flippercloud.io/dashboard). (Create a test project if you'd_prefer.) You can use the existing token or create a new one and then copy the value into your `.env` file.\n\nOnce your `.env` is set up with the `FLIPPER_CLOUD_TOKEN` from your account, you can start up the application:\n\n```bash\nbundle install\nbin/rails db:prepare\nbin/rails server\n```\n\nThen, visit http://localhost:3000 in your browser.\n\n* * *\n\n# Adding Flipper to an Existing Rails App\n\nStep by step instructions for using [Flipper](https://www.flippercloud.io) with Rails.\n\n## Step 1\n\nAdd `flipper` to the `Gemfile`.\n\n```console\n$ bundle add flipper-active_record\n```\n\n* Run `bin/rails g flipper:setup` to generate migration for ActiveRecord adapter.\n* Run `bin/rails db:migrate` to run migration for ActiveRecord adapter.\n\n## Step 2\n\nCreate an account on [flippercloud.io](https://flippercloud.io) and get the token provided during signup.\n\n## Step 3\n\n### Configure cloud using ENV vars (preferred):\n\n```\nFLIPPER_CLOUD_TOKEN=\u003cyour environment token here\u003e\n```\n\n## Step 4\n\nTest that everything works from console:\n\n```bash\nFLIPPER_CLOUD_TOKEN=\u003ctoken-goes-here\u003e bin/rails console\n```\n\n```ruby\nirb(main):006:0\u003e Flipper.enabled?(:foo)\n=\u003e false\nirb(main):007:0\u003e Flipper.enable(:foo)\n=\u003e true\nirb(main):008:0\u003e Flipper.enabled?(:foo)\n=\u003e true\n```\n\nOr test that it works using this demo application:\n\n```bash\ngit clone https://github.com/fewerandfaster/flipper-rails-demo.git\ncd flipper-rails-demo\nFLIPPER_CLOUD_TOKEN=\u003ctoken-from-step-2-goes-here\u003e bin/rails server\n```\n\nOpen http://localhost:3000 in your browser.\n\n## Dotenv\n\nThis app also ships with dotenv so if you `cp .env.example .env` and tweak the token in `.env`, you won't need to export the `FLIPPER_CLOUD_TOKEN` env var for the Rails server or console.\n\n## More?\n\nHead on over to the [Flipper Cloud documentation](https://www.flippercloud.io/docs).\n\nOr check out the [flipper README](https://github.com/jnunemaker/flipper) for links to more documentation and examples on the [types of enablements](https://github.com/jnunemaker/flipper/blob/master/docs/Gates.md) and how to [instrument](https://github.com/jnunemaker/flipper/blob/master/docs/Instrumentation.md) and [optimize](https://github.com/jnunemaker/flipper/blob/master/docs/Optimization.md) your usage of Flipper.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflippercloud%2Fflipper-rails-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflippercloud%2Fflipper-rails-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflippercloud%2Fflipper-rails-demo/lists"}