]> git.openstreetmap.org Git - rails.git/commit
Refactor tracepoint index to use an xml builder view
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 29 Sep 2021 14:14:53 +0000 (15:14 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 29 Sep 2021 14:14:53 +0000 (15:14 +0100)
commit95e5178bfbb2a37bf26b57e4f5dfcb329dd3333c
treee75279faf92b97bbf59ddd7cbaa636d115711ea4
parentc56113aaed2f9312e6f26c37eeddeb29291d515a
Refactor tracepoint index to use an xml builder view

This avoids constructing xml by hand in both the controller and
the model, and opens the way for other rendering in future.

The complexity of deciding which point goes where, along with revisiting
previous tracks and tracksegs means that I've broken it down into
two parts - sorting the points into the right trksegs is done first,
before rendering them all as xml. I couldn't find a way to allow
revisiting using the builder.
app/controllers/api/tracepoints_controller.rb
app/views/api/tracepoints/index.gpx.builder [new file with mode: 0644]