Matthew Margolis wrote:
> I have lighttpd setup with my rails app in a sub folder that is
> proxied through apache. This is causing my compute_public_path to
> return a wrong directory structure(/ instead of /punchlist). I need
> to prefix the returned string with ''/punchlist/''
>
> I tried overwriting ActionController::Base.asset_host =
''/punchlist''
> in environment.rb but this caused my application to just hang.
> Does anyone know of a safe place to overwrite
> ActionController::Base.asset_host or of another way to tell
> compute_public_path that I need a directory prefix?
>
> I have already done
> class ActionController::AbstractRequest
> def relative_url_root() "/some/path" end
> end
>
> And this got my link_tos working but my stylesheet_link_tags and
> javascript_include_tags are still broken.
>
> Thank you,
> Matthew Margolis
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
rorist helped me out in irc. If I put
def compute_public_path(source,dir,ext)
dir = "myprefix/#{dir}"
super(source,dir,ext)
end
in application_helper.rb it lets me choose a prefix for any link
generated by compute_public_path.
Sorry for the noise, hopefully this will help someone else.
-Matt Margolis