aboutsummaryrefslogtreecommitdiff
path: root/app/helpers/sections_helper.rb
blob: 20f602bb96924ca8de228b56cb50107f39feb6b8 (plain)
1
2
3
4
5
6
7
8
module SectionsHelper
  # Render a section as a GeoJSON FeatureCollection
  def geojson_feature_collection(section)
    features = section.resources.map { |res| json_marker_for(res, section) }.join(',')

    raw("{ \"type\": \"FeatureCollection\", \"features\": [ #{features} ] }")
  end
end