On Jan 12, 2011, at 5:07 PM, Marnen Laibow-Koser wrote: > Didde Brockman wrote in post #974306: >> On Jan 12, 2011, at 7:43 AM, Marnen Laibow-Koser wrote: >> >>> Rajesh B. wrote in post #974156: >>>> i am developing a product where i need to know from wich country the >>>> user is logged in .! and display things according to his geolocation . >>>> can any one please help me out with this >> >> Great! Geolocation is always fun. >> >>> Perhaps you want to use the new HTML 5 geolocation features. If not, >>> Google has a similar API available to the public. This is an HTML/JS >>> issue and has nothing to do with Rails. >> >> You may be correct in this statement, but there's also the option of >> segmenting the content on the server side. I.e., in Rails. > > Well, of course Rails should *deal with* the data once acquired. But > acquiring the user's location is a job for the client side, isn't it?
I'm not so sure. It depends on the use case, IMHO. For example. Say you have http://www.mysite.com/ which needs to redirect the visitor to http://www.mysite.co.uk/ if the originating IP resolves to the UK. Using your method, a page would need to load, determine the geographical location and then use meta refresh or a Javascript in order to perform the actual redirect. Using GeoIP on the server side, a redirect_to in the controller could take care of it all in one quick action. But again, it all depends on what you need to do. If it's a matter of simply varying some sort of UI element, the client side way makes sense. Your mileage may vary :) > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > [email protected] > > -- > 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 [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. > -- 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.

