How to use link_to when inside a subdomain

I recently implemented subdomains in my app which is working well.
But is there a way to use link_to that gets you OUT of the subdomain?
For example, if a user is at then

link_to ‘Sign in’, signin_path

will link to but I need the link to
instead point to

I tried link_to “sign in”, signin_path(:host => “”) but no
luck. Any ideas?

This guy did it by patching UrlRewriter:

thanks! i added this as a file in my initializers directory.

module ActionController
class UrlRewriter
def rewrite(options = {})
options[:host] = @request.domain

now signin_url gives Myste Online but signin_path still

Is there a way to fix _path as well as _url?

Is there a way to fix _path as well as _url?

Sorry, I can’t really help you here - I never used the code myself, I
only remembered having read that article. From a cursory look, it seems
to me that rewrite_url is capable of both, depending on the :only_path
parameter, but I am not sure in how far it has a hand in generating the
URL helpers.

I tried delving a bit further into it, but quite frankly, I still find
Rails Routing to be somewhat scary stuff :slight_smile: