rails/rails — pull request #5008 by cpetschnig (2012-02-11 21:49:53+00:00)
Title: engine knows the path where it is mounted

In some cases, an engine might want to know the path where it is mounted by the main app. Here is an example when using the paperclip gem inside an engine:

module MyEngine
class MyAttachment < ActiveRecord::Base
has_attached_file :document, :styles => { :thumb => "100x100>" },
:url => "/document/:id/:style.:extension" # where did the main_app mount me?
end
end

See also https://github.com/rails/rails/issues/4940