Skip to content

Instantly share code, notes, and snippets.

@brennandunn
Forked from tmking/gist:143008
Created July 8, 2009 17:46
Show Gist options
  • Save brennandunn/143009 to your computer and use it in GitHub Desktop.
Save brennandunn/143009 to your computer and use it in GitHub Desktop.
def locate
# @map = GMap.new("map_div")
# @map.control_init(:large_map => false, :map_type => true)
# @map.center_zoom_init([lat,lng],4)
@target_zip = params[:locate][:zip]
if @target_zip =~ /\d+/
@store_list = Store.find(
:all, :origin => @target_zip,
:order => 'distance',
:conditions => 'distance < 70')
else
flash[:notice] = 'Please enter a zip code'
render :action => :whatever_previous_action_is
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment