Forum: Ruby on Rails Distributing controllers across several Rails servers and ur

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Marcus R. (Guest)
on 2007-01-19 17:31
(Received via mailing list)
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
Marcus R. (Guest)
on 2007-09-26 00:37
(Received via mailing list)
On 1/12/07, Marcus R. <removed_email_address@domain.invalid> 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
Jason N. (Guest)
on 2007-09-26 01:11
(Received via mailing list)
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 R. (Guest)
on 2007-09-26 01:11
(Received via mailing list)
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
This topic is locked and can not be replied to.