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

Version Path
flipper-ui-0.25.3 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.25.2 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.25.1 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.25.0 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.24.1 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.24.0 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.23.1 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.23.0 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.22.2 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.22.1 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.22.0 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.21.0 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.21.0.rc2 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.21.0.rc1 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.20.4 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.20.3 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.20.2 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.20.1 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.20.0 lib/flipper/ui/actions/boolean_gate.rb
flipper-ui-0.20.0.beta3 lib/flipper/ui/actions/boolean_gate.rb