Class: CookieFlag::FeaturesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- CookieFlag::FeaturesController
- Defined in:
- app/controllers/cookie_flag/features_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
2 3 4 |
# File 'app/controllers/cookie_flag/features_controller.rb', line 2 def index @features = feature_flags.keys end |
#update ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/cookie_flag/features_controller.rb', line 6 def update feature_name = params[:feature_name] flag = feature_flags[feature_name] enabled = ActiveRecord::Type::Boolean.new.cast(feature_params[:enabled]) if flag && enabled [feature_name] = flag.to_s else .delete(feature_name) end redirect_to action: :index end |