Forum: Ruby on Rails Best way to render KML files using RXML templates

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
1d94db56879170906abf47cd3346d82d?d=identicon&s=25 martinlooker (Guest)
on 2007-06-26 22:09
(Received via mailing list)
I want to produce google maps KML files which are baiscally XML files
with a KML extention. I'm using restful routes and respond_to. The
best way I've found is to use

respond_to do |format|
  format.kml { render :action => "kml" }

will render a kml.rxml template I have but really I want to have
action.rxml rendered for kml files.

Is there are way to acheive this, or add an extra extension like
action.kml.rxml that can be picked up ?

Should I be using register_template_handler("kml", ???) and specify
whichever existing class handles the rxml template handling and use
action.rkml for my templates ?

Any pointers would be really helpful.
This topic is locked and can not be replied to.