app/views/route_sections/show.kml.erb
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark id="route-section-<%= @route_section.id %>">
<%= @route_section.geometry(params[:mode]).kml_representation.html_safe %>
</Placemark>
</Document>
</kml>