class Flipper::UI::Actions::GroupsGate
Public Instance Methods
get()
click to toggle source
# File lib/flipper/ui/actions/groups_gate.rb, line 12 def get feature = flipper[feature_name] @feature = Decorators::Feature.new(feature) breadcrumb 'Home', '/' breadcrumb 'Features', '/features' breadcrumb @feature.key, "/features/#{@feature.key}" breadcrumb 'Add Group' view_response :add_group end
post()
click to toggle source
# File lib/flipper/ui/actions/groups_gate.rb, line 24 def post feature = flipper[feature_name] value = params['value'].to_s.strip if Flipper.group_exists?(value) case params['operation'] when 'enable' feature.enable_group value when 'disable' feature.disable_group value end redirect_to("/features/#{feature.key}") else error = "The group named #{value.inspect} has not been registered." redirect_to("/features/#{feature.key}/groups?error=#{error}") end end