Sha256: 71bdc93ba037ccb190f44eb3eddbb464bbcf11b1e7cf8f0b94182cf08bcccb90
Contents?: true
Size: 584 Bytes
Versions: 30
Compression:
Stored size: 584 Bytes
Contents
require 'flipper/ui/action' require 'flipper/ui/decorators/feature' module Flipper module UI module Actions class BooleanGate < UI::Action include FeatureNameFromRoute route %r{\A/features/(?<feature_name>.*)/boolean/?\Z} def post feature = flipper[feature_name] @feature = Decorators::Feature.new(feature) if params['action'] == 'Enable' feature.enable else feature.disable end redirect_to "/features/#{@feature.key}" end end end end end
Version data entries
30 entries across 30 versions & 1 rubygems