Sha256: ad149ee5ab801607d1527aaad0428f5839a36c2227808c45a73c1dedb2bccfe3
Contents?: true
Size: 787 Bytes
Versions: 19
Compression:
Stored size: 787 Bytes
Contents
require 'flipper/ui/action' require 'flipper/ui/decorators/feature' module Flipper module UI module Actions class PercentageOfActorsGate < UI::Action include FeatureNameFromRoute route %r{\A/features/(?<feature_name>.*)/percentage_of_actors/?\Z} def post feature = flipper[feature_name] @feature = Decorators::Feature.new(feature) begin feature.enable_percentage_of_actors params['value'] rescue ArgumentError => exception error = Rack::Utils.escape("Invalid percentage of actors value: #{exception.message}") redirect_to("/features/#{@feature.key}?error=#{error}") end redirect_to "/features/#{@feature.key}" end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems