Class: Flipper::UI::Actions::PercentageOfActorsGate
- Inherits:
-
Flipper::UI::Action
- Object
- Flipper::UI::Action
- Flipper::UI::Actions::PercentageOfActorsGate
- Defined in:
- lib/flipper/ui/actions/percentage_of_actors_gate.rb
Instance Attribute Summary
Attributes inherited from Flipper::UI::Action
Instance Method Summary collapse
Methods inherited from Flipper::UI::Action
#breadcrumb, #csrf_input_tag, #halt, #header, #initialize, #json_response, public_path, #public_path, #redirect_to, regex, #request_method_name, route, #run, run, #run_other_action, #script_name, #status, #view, #view_response, #view_with_layout, #view_without_layout, views_path, #views_path
Constructor Details
This class inherits a constructor from Flipper::UI::Action
Instance Method Details
#post ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/flipper/ui/actions/percentage_of_actors_gate.rb', line 10 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.}") redirect_to("/features/#{@feature.key}?error=#{error}") end redirect_to "/features/#{@feature.key}" end |