Sha256: 95b865fdf57274e3e0059b5d88a5db4f3abd7e1b16fa46c5bd37b21886e70bd7
Contents?: true
Size: 781 Bytes
Versions: 16
Compression:
Stored size: 781 Bytes
Contents
module Flammarion module RecognizePath def recognize_path(path, options) recognized_path = Rails.application.routes.recognize_path(path, options) rescue ActionController::RoutingError => e unless e.message.start_with? 'No route matches' raise e end Rails::Engine.subclasses.each do |engine| mounted_engine = Rails.application.routes.routes.find{ |r| r.app.app == engine } next unless mounted_engine path_for_engine = path.sub(/^#{mounted_engine.path.spec}/, '') begin recognized_path = engine.routes.recognize_path(path_for_engine, options) break rescue ActionController::RoutingError => e # do nothing end end recognized_path end end end
Version data entries
16 entries across 16 versions & 1 rubygems