0

我想为单个路由/页面修改 rails route helper *_url 的行为。

这是我正在尝试做的事情:

用户访问:
http ://test1.myapp.com/account

所有 *_url 路由助手正常解析为http://test1.myapp.com/

但是,如果用户访问https://myapp.heroku.com/account/billing?id=test1

我希望该页面上的所有 *_url 路由助手解析为:http://test1.myapp.com/ 而不是http://myapp.heroku.com/

那么,是否可以更改特定页面的所有 *_url 助手调用的域位?

对于那些感兴趣的人,我正在尝试为我的应用程序使用 heroku 的搭载 ssl 方法,以获得安全的计费页面。

4

1 回答 1

0

您实际上可以只修改指向计费区域的链接:

<%= link_to "Billing", my_helper_url(test1, :host => "myapp.heroku.com", :protocol => "https") %>
于 2009-12-17T18:01:37.823 回答