On Sat, Oct 18, 2008 at 7:02 PM, John Clancy
<[EMAIL PROTECTED]> wrote:

> I'm thinking a helper called:
>  def link_to_without_www(options, html_options={})
>    [some really awesome code here]
>  end

link_to, image_tag, etc, generate absolute paths without host by
default. That is "/products/32" for example. In that case the browser
knows it has to request that path from the same domain of the
containing page. That's why you can write an application with no
assumption or configuration about its domain and run it in different
machines such as your laptop and your production server.

So, in your case, if you get your domain right the rest of the
application just works in general terms without touching any helper.

You could perhaps write a high-priority filter. That filter says: if
the host of this request starts with "www", remove that and redirect
to the same URL in the resulting domain (in this case you do explicit
the domain).

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to