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

Version Path
js-routes-0.9.3 lib/js_routes/engine.rb
js-routes-0.9.2 lib/js_routes/engine.rb
js-routes-0.9.1 lib/js_routes/engine.rb
js-routes-0.9.0 lib/js_routes/engine.rb
js-routes-0.8.8 lib/js_routes/engine.rb
js-routes-0.8.7 lib/js_routes/engine.rb
js-routes-0.8.6 lib/js_routes/engine.rb
js-routes-0.8.5 lib/js_routes/engine.rb
js-routes-0.8.4 lib/js_routes/engine.rb
js-routes-0.8.3 lib/js_routes/engine.rb
js-routes-0.8.2 lib/js_routes/engine.rb