Created
April 20, 2011 17:40
-
-
Save danreedy/932095 to your computer and use it in GitHub Desktop.
Original Places Controller create method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@place = Place.new(params[:place]) | |
new_was_successful = @place.save | |
if new_was_successful | |
respond_with(@place) do |format| | |
format.html { redirect_to( @place, :notice => "Great, this coke was saved!" ) } | |
record = SimpleGeo::Record.new({ | |
:id => @place.id, | |
:created => Time.now, | |
:lon => params[:place][:longitude], | |
:lat => params[:place][:latitude], | |
:layer => 'com.getcoke.testdata', | |
:properties => { | |
:name => params[:place][:"place_name"], | |
:notes => params[:place][:notes], | |
:address => params[:place][:address], | |
:city => params[:place][:city], | |
:state => params[:place][:state], | |
:zip => params[:place][:zip] | |
} | |
}) | |
SimpleGeo::Client.add_record(record) | |
end | |
else | |
render :action => :new | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment