I want to have ability to edit GeoJSON data as text, in edit page. I use Rails, PostgreSQL with activerecord-postgis-adapter. For encoding data I use rgeo-geojson.
My show view works fine, I encode:
<%= RGeo::GeoJSON.encode(@field.shape, json_parser: :json) %>
But how to upgrade my edit view, so I could edit data in GeoJSON format and save it:
<%= form_for :field, url: field_path(@field), method: :patch do |f| %>
...
<p>
<%= f.label :shape %><br>
<%= f.text_area :shape %>
</p>
...
<% end %>
Sorry if the question look messy