Forum: Rails Engines development relative_url_root in Engines::RailsExtensions::AssetHelpers.plugin_asset_path

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
John Koleszar (Guest)
on 2009-08-11 17:09
(Received via mailing list)

I have a rails app (redmine) running within a sub-uri via the following
directive in environment.rb:

ActionController::AbstractRequest.relative_url_root = "/redmine"

Unfortunately, URLs generated for plugin assets by Engines do not honor
this directive. I don't know Rails, but it seems like an easy fix if you
know how to get at the request object from within Engines. I was
thinking of something along these lines:

--- vendor/plugins/engines/lib/engines/rails_extensions/asset_helpers.rb
(revision 2796)
+++ vendor/plugins/engines/lib/engines/rails_extensions/asset_helpers.rb
(working copy)
@@ -109,5 +109,5 @@
   # Returns the publicly-addressable relative URI for the given asset,
type and plugin
   def self.plugin_asset_path(plugin_name, type, asset)
     raise "No plugin called '#{plugin_name}' - please use the full name
of a loaded plugin." if Engines.plugins[plugin_name].nil?

Can someone point me in the right direction?


This topic is locked and can not be replied to.