    # File lib/merb-core/dispatch/router.rb, line 255
          def resource(*args)
            defaults = args.pop
            options  = extract_options_from_args!(args) || {}
            key      = []
            params   = []

            args.each do |arg|
              if arg.is_a?(Symbol) || arg.is_a?(String)
                key << arg.to_s
              else
                key << arg.class.to_s
                params << arg
              end
            end

            unless route = Merb::Router.resource_routes[key]
              raise Merb::Router::GenerationError, "Resource route not found: #{args.inspect}"
            end

            params << options

            route.generate(params, defaults, true)
          end