Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A visitor should see elections scoped on his country #64

Open
NebJ opened this issue Feb 22, 2013 · 0 comments
Open

A visitor should see elections scoped on his country #64

NebJ opened this issue Feb 22, 2013 · 0 comments
Labels

Comments

@NebJ
Copy link
Member

NebJ commented Feb 22, 2013

We should use the gem Geocoder, more exactly this feature :

In Any Rack-Based Framework

Detect Location of HTTP Request

Get current user's city and country (using IP address). A location method is added to the standard Rack::Request which returns a Geocoder::Result object:

# Rails controller or Sinatra app
city = request.location.city
country = request.location.country_code

Then when arriving on the homepage, we should directly scope elections of the country, so we have to call for example "/country-france" base on the field country_name of geocoder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant