module Flyboy class ApplicationController < ::ApplicationController layout "application" helper Dorsale::AllHelpers # Cross-engine polymorphic_path # TODO : Export to Dorsale ? def engine_polymorphic_path(obj) if obj.class.parent == Object routes = main_app else routes = obj.class.parent::Engine.routes end routes.url_for( :controller => obj.class.model_name.collection, :action => :show, :id => obj.to_param, :only_path => true ) end helper_method :engine_polymorphic_path end end