Sha256: f20030c8e1171ead1a51eaea93414f7352b954f140f2c215130f8d91d16c6eac

Contents?: true

Size: 1.03 KB

Versions: 11

Compression:

Stored size: 1.03 KB

Contents

module ActionDispatch::Routing
  class Mapper
    # =============================================================================
    # Defines the routes to the bootstrap_admin controllers of your app and also
    # defines a "admin root" route based on the bootstrap_admin namespace
    #
    # == Parameters
    # +options+:: regular route options for the "admin root"
    # +block+:: A block configuring namespaced routes, just like a regular
    #           namespace route block
    def bootstrap_admin options = {}, &block
      admin_namespace = options.delete(:namespace) || BootstrapAdmin.admin_namespace
      BootstrapAdmin.admin_namespace = admin_namespace

      root_options = BootstrapAdmin.admin_root_options.
                      merge({:to => admin_namespace.to_s}).
                      merge(options)
      resource admin_namespace, root_options

      if block_given?
        namespace admin_namespace do
          block.call
        end
      end
    end # bootstrap_admin

  end # class Mapper
end # module ActionDispatch::Routing

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bootstrap_admin-1.0.0 lib/bootstrap_admin/routes.rb
bootstrap_admin-0.0.18 lib/bootstrap_admin/routes.rb
bootstrap_admin-0.0.17 lib/bootstrap_admin/routes.rb
bootstrap_admin-0.0.15 lib/bootstrap_admin/routes.rb
bootstrap_admin-0.0.14 lib/bootstrap_admin/routes.rb
bootstrap_admin-0.0.13 lib/bootstrap_admin/routes.rb
bootstrap_admin-0.0.12 lib/bootstrap_admin/routes.rb
bootstrap_admin-0.0.11 lib/bootstrap_admin/routes.rb
bootstrap_admin-0.0.10 lib/bootstrap_admin/routes.rb
bootstrap_admin-0.0.9 lib/bootstrap_admin/routes.rb
bootstrap_admin-0.0.8 lib/bootstrap_admin/routes.rb