Sha256: 2a830fa8b70e4eac12b8f406c4bbffdc5fa5cb8396e806f8bd497b50bf345dec
Contents?: true
Size: 546 Bytes
Versions: 11
Compression:
Stored size: 546 Bytes
Contents
class JsRoutes class Engine < Rails::Engine JS_ROUTES_ASSET = 'js-routes' initializer 'js-routes.dependent_on_routes', :after => "sprockets.environment" do if Rails.application.assets.respond_to?(:register_preprocessor) routes = Rails.root.join('config','routes.rb') Rails.application.assets.register_preprocessor 'application/javascript', :'js-routes_dependent_on_routes' do |ctx,data| ctx.depend_on(routes) if ctx.logical_path == JS_ROUTES_ASSET data end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems