Sha256: 387b5e05bc0c53e14f30b989068500941275d058cf05820134cd9b59acd234ba

Contents?: true

Size: 490 Bytes

Versions: 4

Compression:

Stored size: 490 Bytes

Contents

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

module Flipper
  module UI
    module Actions
      class AddFeature < UI::Action
        route %r{\A/features/new/?\Z}

        def get
          render_read_only if read_only?

          unless Flipper::UI.configuration.feature_creation_enabled
            status 403
            halt view_response(:feature_creation_disabled)
          end

          view_response :add_feature
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
flipper-ui-1.3.2 lib/flipper/ui/actions/add_feature.rb
flipper-ui-1.3.1 lib/flipper/ui/actions/add_feature.rb
flipper-ui-1.3.0 lib/flipper/ui/actions/add_feature.rb
flipper-ui-1.3.0.pre lib/flipper/ui/actions/add_feature.rb