Sha256: 380d4512bf4e486c637a33f19228c8d46beffacf165a9855bf1a99066656f856

Contents?: true

Size: 874 Bytes

Versions: 17

Compression:

Stored size: 874 Bytes

Contents

require 'flipper/ui/action'
require 'flipper/ui/decorators/feature'

module Flipper
  module UI
    module Actions
      class Feature < UI::Action

        route %r{features/[^/]*/?\Z}

        def get
          feature_name = Rack::Utils.unescape(request.path.split("/").last)
          @feature = Decorators::Feature.new(flipper[feature_name])
          @page_title = "#{@feature.key} // Features"
          @percentages = [0, 1, 5, 10, 15, 25, 50, 75, 100]

          breadcrumb "Home", "/"
          breadcrumb "Features", "/features"
          breadcrumb @feature.key

          view_response :feature
        end

        def delete
          feature_name = Rack::Utils.unescape(request.path.split("/").last)
          feature = flipper[feature_name]
          flipper.adapter.remove(feature)
          redirect_to "/features"
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
flipper-ui-0.10.2 lib/flipper/ui/actions/feature.rb
flipper-ui-0.10.1 lib/flipper/ui/actions/feature.rb
flipper-ui-0.10.0 lib/flipper/ui/actions/feature.rb
flipper-ui-0.9.2 lib/flipper/ui/actions/feature.rb
flipper-ui-0.9.1 lib/flipper/ui/actions/feature.rb
flipper-ui-0.9.0 lib/flipper/ui/actions/feature.rb
flipper-ui-0.9.0.beta1 lib/flipper/ui/actions/feature.rb
flipper-ui-0.8.0 lib/flipper/ui/actions/feature.rb
flipper-ui-0.7.5 lib/flipper/ui/actions/feature.rb
flipper-ui-0.7.4 lib/flipper/ui/actions/feature.rb
flipper-ui-0.7.3 lib/flipper/ui/actions/feature.rb
flipper-ui-0.7.2 lib/flipper/ui/actions/feature.rb
flipper-ui-0.7.1 lib/flipper/ui/actions/feature.rb
flipper-ui-0.7.0 lib/flipper/ui/actions/feature.rb
flipper-ui-0.7.0.beta6 lib/flipper/ui/actions/feature.rb
flipper-ui-0.7.0.beta5 lib/flipper/ui/actions/feature.rb
flipper-ui-0.7.0.beta4 lib/flipper/ui/actions/feature.rb