Sha256: 3447e53e95ebda46b3639dae6237c2b161ada44fa6b5a7432b3fe6453c9ff18c

Contents?: true

Size: 650 Bytes

Versions: 11

Compression:

Stored size: 650 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
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
admin_it-1.1.0 config/routes.rb
admin_it-1.0.11 config/routes.rb
admin_it-1.0.10 config/routes.rb
admin_it-1.0.9 config/routes.rb
admin_it-1.0.8 config/routes.rb
admin_it-1.0.7 config/routes.rb
admin_it-1.0.6 config/routes.rb
admin_it-1.0.5 config/routes.rb
admin_it-1.0.4 config/routes.rb
admin_it-1.0.3 config/routes.rb
admin_it-1.0.2 config/routes.rb