Class: FeatureToggle::FeaturesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- FeatureToggle::FeaturesController
- Defined in:
- app/controllers/feature_toggle/features_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
5 6 7 |
# File 'app/controllers/feature_toggle/features_controller.rb', line 5 def index @features = Feature.all.to_a end |
#toggle ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/controllers/feature_toggle/features_controller.rb', line 9 def toggle feature = Feature.where(feature: params[:feature], state: params[:state]).first_or_initialize feature.enable = (params[:enable] == 'true') feature.save render nothing: true end |