Sha256: 96e378a0cdba56166c342a8a9e1b35080c52da1cfed4e342bef9d29e5b0dd440
Contents?: true
Size: 814 Bytes
Versions: 20
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
20 entries across 20 versions & 1 rubygems