views:

96

answers:

1

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.

A: 

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") %>
bensie
thanks. but the problem is that when i vistit myapp.heroku.com all the other links on that page use the *_url routing methods, which points all the links on the page (for example in my navigation's layout) to heroku.com.
Jim Jones
You may want to consider making a simplified layout for the billing area. While it's nice to keep things uniform, it's often better to make it clear you're in a secure billing zone. You would otherwise need to be specific about the host in every helper_url method call.
bensie