Marcus Roberts
2007-Jan-12 12:53 UTC
Distributing controllers across several Rails servers and url_for
Hi, I have an application which is split across two servers. Most of the application runs on one server, but one controller runs on another server. The second controller has no dependency on the first. I need to generate links in the HTML that point to the second server. I''d like to keep the existing helper functions. The documentation for url_for says I can pass in a :host option to specify a different server. However, when I try the following in Edge Rails (version 5509): <%= url_for(:action => "foo", :controller => "bar", :host => "hostname", :protocol => "https")%> it only renders /bar/foo Should url_for work in the way I''m expecting? And if it does, will options like :host pass through form_for and remote_form_for ? Thanks Marcus --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Marcus Roberts
2007-Jan-12 13:48 UTC
Re: Distributing controllers across several Rails servers and url_for
On 1/12/07, Marcus Roberts <marcus.roberts-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > However, when I try the following in Edge Rails (version 5509): > > <%= url_for(:action => "foo", :controller => "bar", :host => > "hostname", :protocol => "https")%> > > it only renders > > /bar/fooTo follow up my own query, passing in :only_path => false generates the full desired absolute URL Marcus --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jason Norris
2007-Jan-12 14:53 UTC
Re: Distributing controllers across several Rails servers and url_for
Excellent. I''m writing an app right now that will use two domains - www. and static. for static content. This will help a lot. Thank you. Jason Marcus Roberts wrote:> On 1/12/07, Marcus Roberts <marcus.roberts-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> However, when I try the following in Edge Rails (version 5509): >> >> <%= url_for(:action => "foo", :controller => "bar", :host => >> "hostname", :protocol => "https")%> >> >> it only renders >> >> /bar/foo >> > > To follow up my own query, passing in :only_path => false generates > the full desired absolute URL > > Marcus > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Marcus Roberts
2007-Jan-12 16:15 UTC
Re: Distributing controllers across several Rails servers and url_for
Jason, One problem I''ve hit is that AJAX security means it won''t access a different domain - for static files you''re fine, but it won''t work for javascript remoting, etc. Marcus On 1/12/07, Jason Norris <jasonmnorris-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Excellent. I''m writing an app right now that will use two domains - www. > and static. for static content. This will help a lot. Thank you. > > Jason > > Marcus Roberts wrote: > > On 1/12/07, Marcus Roberts <marcus.roberts-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > >> However, when I try the following in Edge Rails (version 5509): > >> > >> <%= url_for(:action => "foo", :controller => "bar", :host => > >> "hostname", :protocol => "https")%> > >> > >> it only renders > >> > >> /bar/foo > >> > > > > To follow up my own query, passing in :only_path => false generates > > the full desired absolute URL > > > > Marcus > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---