Re: get server url

Bob Showalter
Wed, 03 Oct 2007 16:19:46 -0000

On 10/3/07, Tarscher <tarscher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
> I need this for mail sending. I''m creating a user activation
system
> that wan run on multiple domains. When I send out a mail the user has
> to click alink to activate it. Ofcourse this link is dependant on the
> domain the site is hosted on.

Use url_for with :only_path set to false to generate full url''s

   activate_link = url_for({:only_path => false}, :controller =>
''account'', :action => ''activate'', :id
=> @user)

Or, if you have a named route for activation, these generate full
url''s by default:

   activate_link = activate_url(:id => @user)