mongoid/mongoid-geospatial

Point in Rails Form Builder

siegfried opened this issue · 2 comments

I use fields_for to create input element for Point.

= f.fields_for :location do |location|
  = location.text_field :x
  = location.text_field :y

This way can create point correctly, but it cannot load the correct values when edit a record. The result is same when I use "latitude" and "longitude" instead of "x" and "y". What way do you recommend? Thanks.

I was using a similar approach and I believe it worked, and it should. Could you paste more code? model?
I'm using a single field, split commas. (x,y,z). But should work your way too.

Excuse me, I cannot find the code. I've switched to PostgreSQL.