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 http://foo.mysite.com then link_to ''Sign in'', signin_path will link to http://foo.myste.com/signin but I need the link to instead point to http://mysite.com/signin. I tried link_to "sign in", signin_path(:host => "mysite.com") but no luck. Any ideas? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
This guy did it by patching UrlRewriter: http://s2.diffuse.it/blog/show/49_Subdomain+routing+with+rails -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks! i added this as a file in my initializers directory.
module ActionController
class UrlRewriter
def rewrite(options = {})
options[:host] = @request.domain
rewrite_url(options)
end
end
end
now signin_url gives http://myste.com/signin but signin_path still
gives http://foo.myste.com/signin
Is there a way to fix _path as well as _url?
On Apr 22, 2:08 pm, Jan Foeh
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> This guy did it by patching
UrlRewriter:http://s2.diffuse.it/blog/show/49_Subdomain+routing+with+rails
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
> 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 :) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---