Created
September 13, 2015 05:34
-
-
Save therako/65d919de2dadcf64e01a to your computer and use it in GitHub Desktop.
Feature Toggle in Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FeatureFlag | |
def self.allow_comments? | |
MomConfig['COMMENTS_SECTION_AVAILABLE'] == 'true' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application.routes.draw do | |
root 'pages#welcome' | |
get '/welcome' => 'pages#welcome' | |
if FeatureFlag.allow_comments? | |
get '/comments' => 'comments#all' | |
get '/comment' => 'comments#new' | |
post '/comment' => 'comments#create' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment