Could I perhaps use url rewriting to put a subdomain on each language?
Help!
On Sep 28, 5:29 pm, phil <p...-o0Q4Q1ys/oVBDgjK7y7TUQ@public.gmane.org>
wrote:> Newby here!
>
> I have an application that has pages that are translated. Clicking on
> flags changes the language. That is working nicely, but, for the
> ''guest'' area I would like to cache these pages as they
never change.
> My problem is that the page has the same url for all the languages.
> I have an action that does this:
> def set_lang
> set_language(params[:language])
> redirect_to(session[:current_page])
> end
>
> Then the page renders content based on the language set via
> set_language.
>
> By using routes is it possible to make the page cacher think the pages
> are different? Perhaps by appending the current language to the front
> of the url? (eg /en/controller/action). I am in over my head as far as
> routing and how to adequately do this.
>
> What I was thinking was this:
> * default route sends user to /language/guest/welcome
> * set language redirects to /language/(current page)
>
> Would this work, and if so, how on earth do I code it!
>
> Sorry for the rambling email.... any insight or solutions most most
> welcome!
>
> Phil
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---