Sha256: b9a7d95e2df920810d46e293490fc793be174f3a2a004aad4882e0a5148b6898
Contents?: true
Size: 419 Bytes
Versions: 50
Compression:
Stored size: 419 Bytes
Contents
module Agilibox::RoutesHelper def engine_polymorphic_path(obj, opts = {}) engine = obj.class.parents[-2] if engine.nil? routes = main_app else routes = engine::Engine.routes end opts = { :controller => "/#{obj.class.to_s.tableize}", :action => :show, :id => obj.to_param, :only_path => true, }.merge(opts) routes.url_for(opts) end end
Version data entries
50 entries across 50 versions & 1 rubygems