Skip to content
This repository

Zero-effort creation of Location-aware Rails application based on W3C Geolocaton API.

branch: master

Updated Readme

latest commit 1b26fd65d9
Abhishek Parolkar authored November 25, 2010
Octocat-spinner-32 app falsified layout October 22, 2009
Octocat-spinner-32 config Added install script October 21, 2009
Octocat-spinner-32 docs added readme October 21, 2009
Octocat-spinner-32 lib Added readme October 21, 2009
Octocat-spinner-32 tasks Om Sree Ganeshaya Namah: October 19, 2009
Octocat-spinner-32 test Om Sree Ganeshaya Namah: October 19, 2009
Octocat-spinner-32 MIT-LICENSE Created helpers October 20, 2009
Octocat-spinner-32 README.markdown Updated Readme November 25, 2010
Octocat-spinner-32 Rakefile Om Sree Ganeshaya Namah: October 19, 2009
Octocat-spinner-32 init.rb Added the reverse geolocation functionality October 20, 2009
Octocat-spinner-32 install.rb Changes in install script October 21, 2009
Octocat-spinner-32 uninstall.rb Om Sree Ganeshaya Namah: October 19, 2009
README.markdown

GeoMereLaal

(जियो मेरे लाल : ji-oo-me-re-laal : "Keep it up baby!")

GeoMereLaal plugin is all you need to create Location-Aware rails application based on W3C Geolocaton API.

Quick Audio Intro: Thanks to Ruby5 Podcast

What's Location-Awareness?

W3C proposed an API in which internet browsers can have capability to retrieve geo-location of the user via multiple sources (Wifi, LBS, IP, browser cookies) and share it with web apps so that apps can serve content based on user's location.

Who supports it?

Web Browser Geolocation API support
Mozilla Firefox supported in Firefox 3.5 and later versions.
Chrome Supports thru Google Gears Geolocation API
Opera Supported in nightly builds – download from this page
Safari Support is coming soon in the IPhone’s Safari browser.
Internet Explorer An experimental support available from IE8.

How do I use it?

Step 1 : Install

 script/plugin install git://github.com/parolkar/geo_mere_laal.git 

Step 2 : Create form (as you always did but with new helpers)

Note: You may want to generate Address model this way script/generate model Address street:string locality:string city:string state:string country:string zip:string lat:string lng:string

   

<% form_tag('#') do  -%>
   <%= label :address,"street","Street" -%>
   <%= street_field :address, "street" %>    
    
   <%= label :address,"locality","Locality" -%>
   <%= locality_field :address, "locality" %>  

   <%= label :address,"city","City" -%>
   <%= city_field :address, "city" %>  

   <%= label :address,"state","State" -%> 
   <%= state_field :address, "state" %>      

   <%= label :address,"country","Country Name" -%>
   <%= country_name_field :address, "country" %>

   <%= label :address,"zip","Postal Code" -%>
   <%= postal_code_field :address, "zip" %>
    
<% end %>

Step 3: ...... there is no step 3 ;-)

The rendered form will auto fill the content with user's geolocation

Output

Copyright (c) 2009 Abhishek Parolkar, released under the MIT license

Something went wrong with that request. Please try again.