1
我想在Rails中構建一個KML文件,我已經成功完成了這個工作,但現在我想提供一個KMZ格式,它將呈現index.kml文件並將其壓縮。這是我陷入困境的地方。我已經更新了MIME類型,如下所示。rails - 渲染模板和zip
Mime::Type.register_alias "application/vnd.google-earth.kml+xml", :kml
Mime::Type.register_alias "application/vnd.google-earth.kmz", :kmz
這裏是我的格式塊
def index
@map_items = Items.all
respond_with(@map_items) do |format|
format.kml
format.kmz { NOT SURE WHAT IS BEST TO DO }
format.georss
end
end
任何幫助,將不勝感激。謝謝!