On 10/1/06, snacktime [email protected] wrote:
I was wondering if edge rails supports the +xml suffix to mime types?
At the present if you send a request to rails using application/xml or
text/xml it will parse the xml and stick it into params, which is
quite nice and I have been using it. However we need to use a custom
mime type and treating mime types that have the +xml suffix as valid
xml would be nice.
So after looking around I found out that rails will work with the +xml
suffix but you have to add your custom mime type first.
Mime::Types.register is documented in rails 1.1, but the method
doesn’t actually exist… So for anyone else looking to register a
custom mime type here is one way to do it. In environment.rb do this:
Mime::LOOKUP[“application/your-custom-mime-type”] = Mime::XML
And rails will in fact look for the +xml suffix on mime types
registered as Mime::XML