Sha256: 66902e5fa1c1a2f0bf3eb682154279c88cb903447fb928a8f02d3a2d10a223a8

Contents?: true

Size: 678 Bytes

Versions: 44

Compression:

Stored size: 678 Bytes

Contents

module Radiant
  module RoutingExtension
  
    def self.included(base)
      base.class_eval do
        alias :draw_without_plugin_routes :draw
        alias :draw :draw_with_plugin_routes
      end
    end
  
    def draw_with_plugin_routes
      draw_without_plugin_routes do |mapper|
        add_extension_routes(mapper)
        yield mapper
      end
    end

    private
  
      def add_extension_routes(mapper)
        Extension.descendants.each do |ext|
          ext.route_definitions.each do |block|
            block.call(mapper)
          end
        end
      end
    
  end
end

ActionController::Routing::RouteSet.class_eval { include Radiant::RoutingExtension }

Version data entries

44 entries across 44 versions & 4 rubygems

Version Path
radiant-1.1.0.beta lib/plugins/extension_patches/lib/routing_extension.rb
radiant-1.0.1 lib/plugins/extension_patches/lib/routing_extension.rb
radiant-1.1.0.alpha lib/plugins/extension_patches/lib/routing_extension.rb
radiant-1.0.0 lib/plugins/extension_patches/lib/routing_extension.rb
radiant-1.0.0.rc5 lib/plugins/extension_patches/lib/routing_extension.rb
radiant-1.0.0.rc4 lib/plugins/extension_patches/lib/routing_extension.rb
radiant-1.0.0.rc3 lib/plugins/extension_patches/lib/routing_extension.rb
radiant-1.0.0.rc2 lib/plugins/extension_patches/lib/routing_extension.rb
radiant-1.0.0.rc1 lib/plugins/extension_patches/lib/routing_extension.rb
radiant-rails3-0.1 lib/plugins/extension_patches/lib/routing_extension.rb
radiantcms-couchrest_model-0.2.4 lib/plugins/extension_patches/lib/routing_extension.rb
radiantcms-couchrest_model-0.2.2 lib/plugins/extension_patches/lib/routing_extension.rb
radiantcms-couchrest_model-0.2.1 lib/plugins/extension_patches/lib/routing_extension.rb
radiantcms-couchrest_model-0.2 lib/plugins/extension_patches/lib/routing_extension.rb
radiantcms-couchrest_model-0.1.9 lib/plugins/extension_patches/lib/routing_extension.rb
radiantcms-couchrest_model-0.1.8 lib/plugins/extension_patches/lib/routing_extension.rb
radiantcms-couchrest_model-0.1.7 lib/plugins/extension_patches/lib/routing_extension.rb
radiantcms-couchrest_model-0.1.6 lib/plugins/extension_patches/lib/routing_extension.rb
radiantcms-couchrest_model-0.1.5 lib/plugins/extension_patches/lib/routing_extension.rb
radiantcms-couchrest_model-0.1.4 lib/plugins/extension_patches/lib/routing_extension.rb