mardi 22 janvier 2019

Rails, Geo-Search using Google map API

@room_address = Room.near("any location");

I am trying to list rooms (from database) located in the searched location. this line is returning error:

Unsupported argument type: 0 (Fixnum)

tried using different set of parameters. But always returns the same error. How to fix this? following is the schema for Rooms

create_table "rooms", force: :cascade do |t|
t.string   "listing_name"
t.text     "summary"
t.string   "address"
t.integer  "price"
t.boolean  "active"
t.integer  "user_id"
t.datetime "created_at",   null: false
t.datetime "updated_at",   null: false
t.float    "latitude"
t.float    "longitude"
t.index ["user_id"], name: "index_rooms_on_user_id"
end

Aucun commentaire:

Enregistrer un commentaire