Sha256: 36eae67bc0f3de3fcb6498ff4a1d43a37d98199143b8a134b558dde26a57db84

Contents?: true

Size: 722 Bytes

Versions: 7

Compression:

Stored size: 722 Bytes

Contents

AdminIt::Engine.routes.draw do
  AdminIt.resources.each do |name, resource|
    resources(resource.plural,
              controller: "admin_it/#{name}",
              except: [:index]) do
      resource.collections.each do |context|
        next unless context.collection?
        get context.context_name, on: :collection
      end
      unless resource.collections.empty?
        get('/', on: :collection, action: resource.default_context)
      end
    end
  end
  unless AdminIt.resources.empty?
    name, resource = AdminIt.resources.first
    get('/',
        controller: "admin_it/#{name}",
        action: resource.default_context)
  end

  # generates signed urls for S3
  resources :signed_url, only: :index
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
admin_it-1.2.6 config/routes.rb
admin_it-1.2.5 config/routes.rb
admin_it-1.2.4 config/routes.rb
admin_it-1.2.3 config/routes.rb
admin_it-1.2.2 config/routes.rb
admin_it-1.2.1 config/routes.rb
admin_it-1.2.0 config/routes.rb