Commit f9d6b89
Changed files (2)
app
controllers
models
app/controllers/location_controller.rb
@@ -22,7 +22,7 @@ class LocationController < UIViewController
@add.enabled = false
@text_field.enabled = false
p @text_field.text
- location = Location.new(@text_field, 1, 1)
+ location = Location.new(@text_field.text, 1, 1)
location.save
end
app/models/location.rb
@@ -9,7 +9,7 @@ class Location
def save
begin
- BW::HTTP.post("http://localhost:3000/api/vi/restaurants", payload: {name: @name, latitude: @latitude, longitude: @longitude} ) do |response|
+ BW::HTTP.post("http://localhost:3000/api/v1/restaurants", payload: { restaurant: { name: @name, latitude: @latitude, longitude: @longitude } } ) do |response|
p response
end
rescue Exception => e