def recognize_path(path, options)
      recognized_paths = []
      recognized_paths << Rails.application.routes.recognize_path(path, options)
    rescue ActionController::RoutingError => exception
      # The main app didn't recognize the path, try the engines...
      Rails::Engine.subclasses.each do |engine|
        engine_instance = engine.instance
        engine_class = engine_instance.class
        begin
          recognized_path = engine_instance.routes.recognize_path(path, options)
          recognized_path[:engine] = engine_class
          recognized_paths << recognized_path
        rescue ActionController::RoutingError
          Tuttle::Engine.logger.info("Routing error recognizing path for #{path}")
        end
      end

      recognized_paths.empty? ? [{ error: exception.message }] : recognized_paths
    end
def recognize_path(path, options)
      recognized_paths = []
      recognized_paths << Rails.application.routes.recognize_path(path, options)
    rescue ActionController::RoutingError => exception
      # The main app didn't recognize the path, try the engines...
      Rails::Engine.subclasses.each do |engine|
        engine_instance = engine.instance
        engine_class = engine_instance.class
        begin
          recognized_path = engine_instance.routes.recognize_path(path, options)
          recognized_path[:engine] = engine_class
          recognized_paths << recognized_path
        rescue ActionController::RoutingError
          Tuttle::Engine.logger.info("Routing error recognizing path for #{path}")
        end
      end

      recognized_paths.empty? ? [{ error: exception.message }] : recognized_paths
    end
a version that handles engines - based on https://gist.github.com/jtanium/6114632
 it's possible that multiple engines could handle a particular path.  So we will
 capture each of them