I want to send the generated view as a kml file with the necessary headers (content type and file expire) ... using the head gives 500, and using response.headers does not affect ...
What should I do?
Check :content_typeforrender .
:content_type
render
You will need to register the KML Mime type. In your config/initializers/mime_types.rb
In your config/initializers/mime_types.rb
Mime::Type.register "application/vnd.google-earth.kml", :kml
Then in your action you can do:
format.kml { ... }
KML Tutorial: http://code.google.com/apis/kml/documentation/kml_tut.html#kml_server
Source: https://habr.com/ru/post/1786985/More articles:How can I replace the message body programmatically in Smalltalk? - smalltalkΠ‘ΠΎΠ·Π΄Π°ΡΡ "ΠΠ±Π½ΠΎΠ²ΠΈΡΡ ΡΠΊΡΠΈΠΏΡΡ" Π΄Π»Ρ ΠΏΡΠΎΠ΅ΠΊΡΠ° Π±Π°Π·Ρ Π΄Π°Π½Π½ΡΡ ? - visual-studio-2010ActiveRecord query for three models? - ruby-on-railsΠΠ΅ΠΎΠ±ΡΡΡΠ½ΠΈΠΌΡΠ΅ Java-ΠΌΠ°Ρ ΠΈΠ½Π°ΡΠΈΠΈ - Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ, Ρ ΠΏΠΎΡΠΎΠΊΠ°ΠΌΠΈ? - javaSpring / LDAP - calling setter methods in beans configuration - javaCapture EMGU CV camera in WPF? - c #Android ScrollView: automatically scrolls to a few pixels (dips) over a particular view - androidHow to programmatically change the startColor attribute of a gradient - Android - androidWPF ΠΎΠ±ΡΠ΅Π΄ΠΈΠ½ΡΠ΅Ρ Π΄Π²Π΅ ΠΊΠΎΠ»Π»Π΅ΠΊΡΠΈΠΈ Π² ΠΎΠ΄Π½ΠΎΠΉ DataGrid - collectionsDatabinding a ObservableCollection Π² MVVM - c#All Articles