You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-18Lines changed: 10 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
-
# Flipper Rails Demo
1
+
# Flipper Rails Playground
2
2
3
-
This is an example Rails application that serves as a working demo to walk you through the basics of using Flipper. You can run the demo and interact with the
4
-
feature toggles, or you can browser the source code to see the commands for toggling features.
3
+
This 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.
5
4
6
5
## Automated Setup (Fast and Easy)
7
6
@@ -11,7 +10,7 @@ Once you've pulled down the repo, you should be able to run `bin/setup`, and the
11
10
$ bin/setup
12
11
```
13
12
14
-
This demo already has the pre-requisites setup and ready to go. You only need to add the `FLIPPER_CLOUD_TOKEN`.
13
+
This app already has the pre-requisites setup and ready to go.
15
14
16
15
## Manual Setup (See how it all works!)
17
16
@@ -21,7 +20,7 @@ This demo already has the pre-requisites setup and ready to go. You only need to
21
20
$ cp .env.example .env
22
21
```
23
22
24
-
2. Get your `FLIPPER_CLOUD_TOKEN` by going to your project's "Tokens" page. (Create a test project for the demo if you'd_prefer.) You can use the existing token or create a new one and then copy the value into your `.env` file.
23
+
1. 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.
25
24
26
25
Once your `.env` is set up with the `FLIPPER_CLOUD_TOKEN` from your account, you can start up the application:
27
26
@@ -31,26 +30,23 @@ bin/rails db:prepare
31
30
bin/rails server
32
31
```
33
32
34
-
Then, once the server is running, you can toggle the feature via command-line with the instructions shown on the home page.
33
+
Then, visit http://localhost:3000 in your browser.
35
34
36
35
* * *
37
36
38
37
# Adding Flipper to an Existing Rails App
39
38
40
-
Step by step instructions for using [Flipper](https://flippercloud.io) with Rails.
39
+
Step by step instructions for using [Flipper](https://www.flippercloud.io) with Rails.
41
40
42
41
## Step 1
43
42
44
-
Add `flipper-cloud` to the `Gemfile`.
43
+
Add `flipper` to the `Gemfile`.
45
44
46
-
```ruby
47
-
flipper_version ='~> 0.25.0'
48
-
gem 'flipper-cloud', flipper_version
49
-
gem 'flipper-active_record', flipper_version
45
+
```console
46
+
$ bundle add flipper-active_record
50
47
```
51
48
52
-
* Run `bundle` to install.
53
-
* Run `bin/rails g flipper:active_record` to generate migration for ActiveRecord adapter.
49
+
* Run `bin/rails g flipper:setup` to generate migration for ActiveRecord adapter.
54
50
* Run `bin/rails db:migrate` to run migration for ActiveRecord adapter.
55
51
56
52
## Step 2
@@ -62,11 +58,7 @@ Create an account on [flippercloud.io](https://flippercloud.io) and get the toke
62
58
### Configure cloud using ENV vars (preferred):
63
59
64
60
```
65
-
# required
66
61
FLIPPER_CLOUD_TOKEN=<your environment token here>
67
-
68
-
# optional (for production environment so you never poll cloud)
0 commit comments