Reputation: 1780
Straight-forward enough problem: everything renders just fine if I remove either geojson or csv, but when both are in the block, the first one is rendered no matter what Content-Type header I send along (text/csv
or vnd.geo+json
). I do have custom MIME types and renderers, but these don't seem to be the problem since when I use one or the other, everything works as expected, but it is only when I try to reference multiple formats does only the first format end up being used, regardless of header.
def all
resource = Thing.where.not(thing_type: BaseThing::ONE_OF_THE_THINGS).order(:unique_id)
respond_to do |format|
format.geojson do
render geojson: Things::GeoSerializer.to_geojson(resource)
end
format.csv do
render csv: Things::CsvSerializer.to_csv(resource), filename: 'things'
end
end
end
Upvotes: 1
Views: 304