开发者

Modifying rails route helper

I'd like to modify the behavior of the rails route helper *_url for a single route/page.

Here's what I'm try to do:

User visits:

http://test1.myapp.com/account

All the *_url routing helpers resolve to http://test1.myapp.com/ as normal.

But, then if the user goes to https://myapp.heroku.com/account/billing?id=test1

I'd like all the *_url routing helpers on that page to开发者_开发技巧 resolve to: http://test1.myapp.com/ instead of http://myapp.heroku.com/

So, is it possible to change the domain bit for all the *_url helper calls for a specific page?

For those interested, I'm trying to use heroku's piggyback ssl method for my app for just a secured billing page.


You can actually just modify the links that point to the billing area:

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜