Sha256: e58e5697ec2ccd6dbd0b3fc9e18a9945b12f0141f2d510174594cd9532bd33b9
Contents?: true
Size: 418 Bytes
Versions: 10
Compression:
Stored size: 418 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
10 entries across 10 versions & 1 rubygems