Sha256: a6e1a529760d59dc388700677561fd218d1cd6dcdecef8243a6dfc72d23c44ee
Contents?: true
Size: 814 Bytes
Versions: 17
Compression:
Stored size: 814 Bytes
Contents
require 'flipper/ui/action' require 'flipper/ui/decorators/feature' module Flipper module UI module Actions class PercentageOfActorsGate < UI::Action route %r{features/[^/]*/percentage_of_actors/?\Z} def post feature_name = Rack::Utils.unescape(request.path.split('/')[-2]) feature = flipper[feature_name.to_sym] @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
17 entries across 17 versions & 1 rubygems