Permalink
Browse files

API is DONE!!!!

  • Loading branch information...
1 parent aa45ad4 commit f8b2c9e7477f0dacdfe620982f802249d1a47b89 @ajb committed Jul 21, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 app/controllers/stations_controller.rb
@@ -1,8 +1,12 @@
-class StationsController < ApplicationController
+ class StationsController < ApplicationController
# GET /stations
# GET /stations.json
def index
- @stations = Station.all
+ if params[:lat] && params[:lng]
+ @stations = Station.near([params[:lat], params[:lng]], 200)
+ else
+ @stations = Station.all
+ end
respond_to do |format|
format.html # index.html.erb

0 comments on commit f8b2c9e

Please sign in to comment.