Skip to content

Instantly share code, notes, and snippets.

@makoto
Created February 26, 2009 19:53
Show Gist options
  • Select an option

  • Save makoto/71066 to your computer and use it in GitHub Desktop.

Select an option

Save makoto/71066 to your computer and use it in GitHub Desktop.
require 'rho/rhocontroller'
class GeoTimeLineController < Rho::RhoController
#GET /GeoTimeLine
def index
latitude = GeoLocation.latitude.to_s
longitude = GeoLocation.longitude.to_s
range = "25km"
question = "#{latitude},#{longitude}"
@GeoTimeLines = GeoTimeLine.ask(question)
p "@GeoTimeLines.class"
p @GeoTimeLines.class
require 'rhom'
p "Rhom::RhomDbAdapter::select_from_table"
Rhom::RhomDbAdapter::select_from_table('object_values','*', :source_id => 13)
render :action => :index
end
# GET /GeoTimeLine/1
def show
@GeoTimeLine = GeoTimeLine.find(@params['id'])
render :action => :show
end
# GET /GeoTimeLine/new
def new
@GeoTimeLine = GeoTimeLine.new
render :action => :new
end
# GET /GeoTimeLine/1/edit
def edit
@GeoTimeLine = GeoTimeLine.find(@params['id'])
render :action => :edit
end
# POST /GeoTimeLine/create
def create
@GeoTimeLine = GeoTimeLine.new(@params['GeoTimeLine'])
@GeoTimeLine.save
redirect :action => :index
end
# POST /GeoTimeLine/1/update
def update
@GeoTimeLine = GeoTimeLine.find(@params['id'])
@GeoTimeLine.update_attributes(@params['GeoTimeLine'])
redirect :action => :index
end
# POST /GeoTimeLine/1/delete
def delete
@GeoTimeLine = GeoTimeLine.find(@params['id'])
@GeoTimeLine.destroy
redirect :action => :index
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment