修改rails路由助手

时间:2009-12-17 17:39:22

标签: ruby-on-rails heroku

我想修改单个路由/页面的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方法为我的应用程序提供一个安全的结算页面。

1 个答案:

答案 0 :(得分:0)

您实际上只需修改指向结算区域的链接:

<%= link_to "Billing", my_helper_url(test1, :host => "myapp.heroku.com", :protocol => "https") %>