Skip to content

Instantly share code, notes, and snippets.

@dmclark
Created October 20, 2010 18:05
Show Gist options
  • Save dmclark/636958 to your computer and use it in GitHub Desktop.
Save dmclark/636958 to your computer and use it in GitHub Desktop.
class DirectionsController < ApplicationController
def new
@direction = Direction.new
@venues = Venue.all
end
def create
@direction = Direction.new(params[:direction])
if @direction.valid?
# TODO send direction here
flash[:notice] = "go"
redirect_to get_directions_path( :start => params[:direction][:start],
:destination => params[:direction][:destination] )
else
render :action => 'new'
end
end
def show
start = Venue.find(params[:start]).location
destination = Venue.find(params[:destination]).location
@directions = GoogleDirections.new(start,destination).xml + 'xxxxxxxx'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment