I believe the tg was needed for older versions, but was changed at some point 
in time.  Either with or without the tg seems to work for me as well.
Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: León Domingo <[email protected]>
Sender: [email protected]
Date: Thu, 16 Feb 2012 19:34:58 
To: <[email protected]>
Reply-To: [email protected]
Subject: Re: [TurboGears] tg.url usage

Yes, to be precise it's not a relative URL but I have no problem using
/foo/bar/
If i'm developing /foo/bar would take me to http://localhost:8081/foo/bar
In some production environment would take me to http://somedaim.com/foo/bar.

That's why I'm asking the use of tg.url()

León Domingo

Ender - Factoría de Software
[email protected] <[email protected]>
Avda. Cerro del Águila, 7. S23 - 2ª Planta
28703 S.S. de los Reyes (MADRID)
Tlf. 902 01 44 01

<http://www.ender.es/>
<http://www.facebook.com/home.php?#%21/pages/San-Sebastian-de-los-Reyes-Spain/Ender-Factoria-de-Software/142213119143359?ref=ts>
* <http://www.ender.es>*


On 16 February 2012 17:39, Robert Forkel <[email protected]> wrote:

> That's not really a relative url. So it won't work when your app is
> mounted at a path prefix.
>
> Am 16.02.2012 17:34 schrieb "León Domingo" <[email protected]>:
>
>> Hi people,
>> Why should I use tg.url(....) instead of a simply relative-URL?
>>
>> Lately, i'm not using it because to me it looks cleaner this:
>>
>> $.ajax({
>>  url: "/foo/bar/",
>>  ...
>> });
>>
>> than this
>>
>> $.ajax({
>>  url: "{{tg.url('/foo/bar/')}}",
>>  ...
>> });
>>
>> and the result is the same...
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "TurboGears" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/turbogears?hl=en.
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to