I want to execute the following javascript functions in a model or in a controller, and work with result . navigator.systemLanguage navigator.userLanguage how can i do? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jean-sébastien Jney wrote:> I want to execute the following javascript functions in a model or in > a controller, and work with result . > navigator.systemLanguage > navigator.userLanguage > > how can i do?Models and controllers are server-side entities. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
and? ajax is asynchronous so i can you code i''ve taken from client in my server side On Apr 19, 10:28 pm, Guest <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Jean-sébastien Jney wrote: > > I want to execute the following javascript functions in a model or in > > a controller, and work with result . > > navigator.systemLanguage > > navigator.userLanguage > > > how can i do? > > Models and controllers are server-side entities. > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jean-Sébastien wrote:> I want to execute the following javascript functions in a model or in > a controller, and work with result . > navigator.systemLanguage > navigator.userLanguageAdd this to an action: raise request.env.inspect That shows the HTTP headers. One of them should specify the language. -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks philips, i knew it, it is request.env["HTTP_ACCEPT_LANGUAGE"], but those javascript functions give me navigator language and os language. anyway i think you''re right i will use this method. On Apr 20, 4:16 am, "Phlip" <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Jean-Sébastien wrote: > > I want to execute the following javascript functions in a model or in > > a controller, and work with result . > > navigator.systemLanguage > > navigator.userLanguage > > Add this to an action: > > raise request.env.inspect > > That shows the HTTP headers. One of them should specify the language. > > -- > Phlip > http://www.oreilly.com/catalog/9780596510657/ > "Test Driven Ajax (on Rails)" > assert_xpath, assert_javascript, & assert_ajax--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jean-sébastien Jney wrote:> thanks philips, i knew it, it is request.env["HTTP_ACCEPT_LANGUAGE"], > but those javascript functions give me navigator language and os > language. > anyway i think you''re right i will use this method.Yes, you can work with request headers on the server side, since servers actually know about requests. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---