mirror of
https://github.com/wahyd4/Libr.git
synced 2026-08-09 04:46:07 +10:00
fix bug to create location
This commit is contained in:
@@ -15,7 +15,8 @@ class Api::V1::LocationsController < ApplicationController
|
||||
user = User.find_by_email params[:user_email]
|
||||
lat = params[:lat]
|
||||
lng= params[:lng]
|
||||
location = user.locations.create lat: lat, lng: lng
|
||||
address = params[:address]
|
||||
location = user.locations.create lat: lat, lng: lng, address: address
|
||||
render json: location
|
||||
|
||||
end
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class Location < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
|
||||
attr_accessible :lng, :lat, :address
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user