开发者

resource_url generating wrong url

开发者 https://www.devze.com 2023-02-10 02:05 出处:网络
I have a rails app in a subdirectory of my server, something like www.domain.com/sub I need to send an url by e-mail, so I tried to use \"resource_url\" but it generates a开发者_开发技巧 link like www

I have a rails app in a subdirectory of my server, something like www.domain.com/sub I need to send an url by e-mail, so I tried to use "resource_url" but it generates a开发者_开发技巧 link like www.domain.com/resource_path, where should be wwww.domain.com/sub/resource_path.

How can I solve this ?

Thanks!


In Rails 2.3.8 you can add a line like this to your config/environments/production.rb

ActionController::Base.relative_url_root = "/sub"

I am not sure what the equivalent is for Rails 3, but see this question if that is what you are using: What is the replacement for ActionController::Base.relative_url_root?

0

精彩评论

暂无评论...
验证码 换一张
取 消