Sha256: 411b553b2fd57eeb8e91d194b8a0ae4fdb350f3166cb3e810c5eeeef0cfebc65
Contents?: true
Size: 806 Bytes
Versions: 17
Compression:
Stored size: 806 Bytes
Contents
require 'flipper/ui/action' require 'flipper/ui/decorators/feature' module Flipper module UI module Actions class PercentageOfTimeGate < UI::Action route %r{features/[^/]*/percentage_of_time/?\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_time params['value'] rescue ArgumentError => exception error = Rack::Utils.escape("Invalid percentage of time 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